Live data from Hacker News

AngularJS 1.2.0: timely-delivery

blog.angularjs.org

51–60 of 64 posts

Re: AngularJS 1.2.0: timely-delivery

#52
post #41
post #30

Earlier quoted context omitted.

Here's your example without a watch: http://plnkr.co/edit/GCv7bQALiOTgJ0npavwi?p=preview

That looks interesting, so does the filter reevaluate automatically when any of the variables used in the expression change? edit: and thanks a lot for taking the time to look at it!

Ah, so I see that anything associated to the scope is reavaluated whenever anything else in the scope changes. Here's a further modification based on yours that keeps the criteria on the controller.

[1] http://plnkr.co/edit/JYyUvyh30e5L9KwVjDW2?p=preview

[2] http://plnkr.co/edit/ffYb14JjgSip5BTITILS?p=preview

edit: much happier with this version than the one I started with, thanks

edit: added example [2] which doesn't require a watch but still uses the service to do the filtering (because in my app it's actually an ajax call)

Re: AngularJS 1.2.0: timely-delivery

#53
post #46

Earlier quoted context omitted.

Its Blogger -- doing it this way allows them to cache the viewer across their thousands of blogs, and load only the content.

Well, if they just served html, they'd still only need to serve the content (and the viewer, the web browser, would indeed be cached in the form of an installed application on the end user's system).

The content can be served as a JSON object containing just the post and the metadata. If you scale up to millions of requests, suddenly you're saving a lot of bandwidth by not sending the same header, sidebar, footer etc everytime.

Re: AngularJS 1.2.0: timely-delivery

#54
post #7

"This commit introduces the notion of "private" properties (properties whose names begin and/or end with an underscore) on the scope chain. These properties will not be available to Angular expressions." I wish they'd discuss stuff like this and I wish that MongoDB did not store primary keys on _id field. I blame myself though.

This change was discussed: https://github.com/angular/angular.js/pull/4509 It is also clear from the discussion that there are dissenting opinions -- we are constantly iterating and welcome issues and pull requests to make features work even better. The best way to influence AngularJS is to send a pull request.

I pay pretty close attention to the issues in the repo, but I apparently missed this. I am also a regular in #angularjs, and never seen it discussed there either, so while the discussion was public, I think it caught almost everyone by surprise.

Re: AngularJS 1.2.0: timely-delivery

#56
post #46

Earlier quoted context omitted.

Well, if they just served html, they'd still only need to serve the content (and the viewer, the web browser, would indeed be cached in the form of an installed application on the end user's system).

The content can be served as a JSON object containing just the post and the metadata. If you scale up to millions of requests, suddenly you're saving a lot of bandwidth by not sending the same header, sidebar, footer etc everytime.

Just send binary (that next?)

Re: AngularJS 1.2.0: timely-delivery

#57
post #55

I just wrote a yeoman generator to bootstrap a phonegap application with angular 1.2.0 : https://github.com/dsimard/generator-angular-phonegap

Here is a video showing how to bootstrap an angular-phonegap application in 6 commands : http://www.youtube.com/watch?v=UXkLu7q4tq4

Re: AngularJS 1.2.0: timely-delivery

#59
post #47

Earlier quoted context omitted.

This change was discussed: https://github.com/angular/angular.js/pull/4509 It is also clear from the discussion that there are dissenting opinions -- we are constantly iterating and welcome issues and pull requests to make features work even better. The best way to influence AngularJS is to send a pull request.

You are right it was. But most people do not track all issues of all projects they depend on. While I'd love to do that, there's simply not much time. I belive this should have been in an earlier RC or Beta. This way, more people would have tested ot, ir got a chance to read changelog (I follow the blog and check each beta release). If that window was missed, it should have gone for the next major release. What I see…

Many other languages and projects use underscores to indicate private properties, in particular Google's Closure. I also have no idea how standardizing on _ in names meaning private would do anything to push Dart in some hidden, evil agenda.

I think the change is reasonable, limiting AngularJS' expression to leak less information into the templates is a good idea IMHO, as described in particular with the new controller syntax.

Disclosure: I work at Google, but I have not been involved in this discussion at all.

Re: AngularJS 1.2.0: timely-delivery

#60
post #46

Earlier quoted context omitted.

Well, if they just served html, they'd still only need to serve the content (and the viewer, the web browser, would indeed be cached in the form of an installed application on the end user's system).

The content can be served as a JSON object containing just the post and the metadata. If you scale up to millions of requests, suddenly you're saving a lot of bandwidth by not sending the same header, sidebar, footer etc everytime.

1) You could send the sidebar, footer etc as json, and the content as html. [edit: an by json I mean javascript ;-) or a combination of a script-tag with a fancy-nav.js, and then pull in any additional elements via json/javascript urls]

2) "lot of bandwidth" - I doubt it. It's only the embedded html you'd have to resend -- and that gets compressed with the rest of the main html document. Everything else (images, css, javascript) gets cached via normal request caching.

Post reply on HN