Hi Zlatko,

Depends on the application and the backend really. If you have a trusted 
backend you don't need the verify each row that comes from there. Also, 
it depends on what you need to do on 'error'.  In some cases, I add a 
verifyAndProvideDefaults method to my companion class. You can then do 
something like this:

  getPosts() {
        return this.http.get('/api/posts')
            .map((res: Response) => <Post[]>res.json())
            .map(data => data.map(companionClass.verifyAndProvideDefaults))

that's probably still a lot quicker as instantiating a load of row classes.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to