Sander, can you please enlighten me? I was under the impression that
"casting" backend responses is just for static checks - when you compile
Angular to JavaScript (to deploy to prod, or even run in browser), that no
checks are actually enforced?
E.g. take something like this:
class Post {
author: string;
content: string;
}
class PostService {
constructor(private http: Http) {}
getPosts() {
return this.http.get('/api/posts')
.map((res: Response) => <Post[]>res.json());
}
}
When that's compiled, we don't get any enforcements on *name* or *content*
properties,
those are used just for static checks (and IDE assistance).
Am I wrong about that? Because if I'm not, than the original question - on
performance dilemma - is moot, it doesn't matter, right?
--
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.