Live data from Hacker News

AngularJS 1.2.0: timely-delivery

blog.angularjs.org

21–30 of 64 posts

Re: AngularJS 1.2.0: timely-delivery

#21
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.

I'm running into a similar issue and fairly new to angular. In fact, the tutorial I followed even set up the server calls to use the _id field when looking at a specific model (ie leagues/{{ league._id }} ). What's the proper way to go about fixing this?

Re: AngularJS 1.2.0: timely-delivery

#22
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.

I'm running into a similar issue and fairly new to angular. In fact, the tutorial I followed even set up the server calls to use the _id field when looking at a specific model (ie leagues/{{ league._id }} ). What's the proper way to go about fixing this?

You can always create functions that refer to the private element:

MyObject.prototype.id = function(){return this._id;};

Which gives you: leagues/{{ league.id() }}

Re: AngularJS 1.2.0: timely-delivery

#23
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.

I'm running into a similar issue and fairly new to angular. In fact, the tutorial I followed even set up the server calls to use the _id field when looking at a specific model (ie leagues/{{ league._id }} ). What's the proper way to go about fixing this?

Don't use 1.2.0 until it's reverted or write a getter.

Re: AngularJS 1.2.0: timely-delivery

#24

We've been using rc versions in production code too. As they've mentioned many times when they say unstable it doesn't mean that it was likely to break, simply that they are free to change the API if they need too. Does anyone know what's the rationale behind the separation of ngRoute? It's less than 4KB and less than 2KB when gzipped. I don't think it's worth the "pain" of having to remember to add another source fi…

what is your build process? (angular noob here)but I would assume your dependency resolution takes care of this. (this sounds to me like build vs real issue)

Re: AngularJS 1.2.0: timely-delivery

#25

We've been using rc versions in production code too. As they've mentioned many times when they say unstable it doesn't mean that it was likely to break, simply that they are free to change the API if they need too. Does anyone know what's the rationale behind the separation of ngRoute? It's less than 4KB and less than 2KB when gzipped. I don't think it's worth the "pain" of having to remember to add another source fi…

They want to split in lot of optional modules, it's just the beginning. IMO it's a good idea. For your problem, perhaps they should add a custom build/download tool like jQueryUI.

I think it's a great idea as well. Would like to see jqLite come out as well and be a separate project. Then those using jquery don't pay for jqLite, and even beter, for a quick landing page I'd be inclined to use jqLite naked for a nice tiny footprint.

Re: AngularJS 1.2.0: timely-delivery

#26
post #9

I've done one project with ember and was very happy with it but I'm now working on a project where I only need parts of the page to be controlled by the framework. So far I'm loving the way angular integrates with the dom but once you get back to the controllers/directives it suddenly feels like I have to do a whole lot more work than with ember. The main difference seems to be that you have to manage updates yoursel…

Can you give an example of where you've had to use $watch? Usually too many $watch is an indication that you could improve your app's architecture, e.g. by abstracting into directives. FWIW I'm only speaking from personal experience and in your case lots of $watch might be necessary.

A good example is where I have a list of items which is filtered by a select[1]. I have the select wired up to the controller with a two-way binding and the controller watches for changes to the binding and filters the list accordingly. Maybe this isn't an idiomatic way to do it?

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

Re: AngularJS 1.2.0: timely-delivery

#28
With Javascript disabled the page is completely blank.

edit (bringing text from comment up a level):

If you are building apps for people other than yourself, then having a banner to notify them it won't work is better than a blank page.

A typical banner that I make includes the following things:

- Positioned at the top via CSS and sticks there

- Includes a link to http://www.enable-javascript.com

- Includes a tracking image so I can see how many people are coming without JS enabled

If you have a white page like this blog does, people will think your site is broken and bounce... and may never come back.

Re: AngularJS 1.2.0: timely-delivery

#29

With Javascript disabled the page is completely blank. edit (bringing text from comment up a level): If you are building apps for people other than yourself, then having a banner to notify them it won't work is better than a blank page. A typical banner that I make includes the following things: - Positioned at the top via CSS and sticks there - Includes a link to http://www.enable-javascript.com - Includes a trackin…

Not sure what you were expecting. AngularJS apps aren't usually built with a noJS fallback in mind.

Re: AngularJS 1.2.0: timely-delivery

#30
post #26

Earlier quoted context omitted.

Can you give an example of where you've had to use $watch? Usually too many $watch is an indication that you could improve your app's architecture, e.g. by abstracting into directives. FWIW I'm only speaking from personal experience and in your case lots of $watch might be necessary.

A good example is where I have a list of items which is filtered by a select[1]. I have the select wired up to the controller with a two-way binding and the controller watches for changes to the binding and filters the list accordingly. Maybe this isn't an idiomatic way to do it? [1] http://plnkr.co/edit/ykfblPHlwkBJyMeObFyV?p=preview

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