7 ms·
AngularJS 1.2.0-rc1 released
- jacques_chester 13y agoI know this is the wrong place to vent, but it would be nice if ngRepeat properly supported recursive data structures without having to write new directives. Edit: and yes, I did actually crack open the source to see if I could make that change. In places it's ... pretty densely written. It seems to me that at least checking to see if an array has any elements and aborting if it's empty would go some of the way to stopping the locking-up problem, but I couldn't work out if that was so. So like everyone else I have a frankenstein pair of directives to achieve the same thing.
- hueyp 13y ago`ng-repeat` and `ng-include` work fine for recursive data structures. http://jsfiddle.net/uXbn6/378/ http://jsfiddle.net/uXbn6/378/
- jacques_chester 13y agoI had that as a previous approach, actually. Creating two nested scopes for each item made debugging even harder. It would also be nice if it just did the expected thing out of the box. I can accept that there may well be sound technical reasons for the way it is, but I haven't seen any. All that happens when you raise this limitation is one of three things: 1. "Use ngIf". 2. "Use ngInclude". 3. "Write your own directives". I tried 1 and 2, that's why I'm on 3.
- hueyp 13y agoCan you include a sample of a template with your custom directive? I'm not sure what the expected thing out of the box would be. (not the code of the directive, just the use)
- jacques_chester 13y agoHere's the original article I took inspiration from: http://sporto.github.io/blog/2013/06/24/nested-recursive-directives-in-angular/ http://sporto.github.io/blog/2013/06/24/nested-recursive-dir... I've modified it a bit to add a $watchCollection listener. So when a recursive array is updated, it deletes a child OL and then recompiles again: https://gist.github.com/jchester/6227865 https://gist.github.com/jchester/6227865 I don't particularly like the fact that this creates a dependency on jQuery (through .empty()). There are other approaches where the recursion is sorta-kinda-but-not-really built into a single directive: https://gist.github.com/furf/4331090 https://gist.github.com/furf/4331090 https://github.com/eu81273/angular.treeview https://github.com/eu81273/angular.treeview Edit: I guess what I wished for would be something like this -- <div ng-repeat="recursive items in sub_items">{{foo}}</div> or <div ng-recursive="items in sub_items">{{foo}}</div> or <div ng-repeat="items in sub_items" ng-recursive>{{foo}}</div> Whichever is easiest to get into the mainline code.
- sixbrx 13y agoThis would also be useful for me. To properly do the recursion though, I think it needs to have a function attribute "recurse-by" specified which, at any level in the structure, returns the items for the next level.
- sergiotapia 13y ago'spooky-giraffe'? :/ What happened to the cool release names such as Longhorn, Maverick, Feisty Fawn, et al? These days libraries have such funky names, kind of odd. There's a ruby gem out there that's called Steak. Yep, Steak.
- dchuk 13y agoI'm pretty sure Angular uses these funky release names sarcastically.
- phaedryx 13y agoIn context, there are lots of acceptance test frameworks for ruby, e.g. cucumber, spinach, and turnip. Steak is great marketing. Why use cucumber when you could have steak?
- iSnow 13y agoActually, `spooky-giraffe` made me smile because it's such a nice contrast to the overused and tiresome macho code names like `Longhorn` or `Mountain Lion`. I hope the next Angular release will be `superheroic earthworm` or something like that.
- tyre 13y agoUsing Angular was a huge pleasure for developing a Chrome Packaged App in every way but one. Documentation. It isn't sexy to write docs; as a developer you don't get that feeling of 'shipping code', but it is one of the most important parts of an open source library. Knowing that your question is always a google away (not a 'I hope someone asked this on StackOverflow' away) is important and I hope they improve in this arena.
- jacques_chester 13y agoI concur on the documentation. I spend as much time reading the code to understand the documentation as I do reading documentation to understand code. That seems perverse to me.
- saiko-chriskun 13y agoam I the only one that has never had an issue with angular's docs? :P
- jacques_chester 13y agoYou might well be.
- taude 13y agoLikely. I don't think the "docs" of the core framework are so bad is that there's nothing that really explains "The Why" well. I have a hard time with understanding unless I know The Why, and it's mostly an exercise in rote learning until then, and I think rote learning for something complex like AngularJS is a bad thing
- yesimahuman 13y agoMy favorite Angular doc page: http://docs.angularjs.org/api/ng.directive:ngModel http://docs.angularjs.org/api/ng.directive:ngModel
- epoxyhockey 13y agoFunny that your link was light-gray in color when I loaded these comments (meaning that I, too, once went to that page looking for documentation).
- rgbrgb 13y agoWhat's the best way to install this with bower?
- revetkn 13y agoActually, there is a faster way than bower! 1. Download (or point to) https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/ang... 2. You're done
- deleted 13y ago[deleted]
- lucisferre 13y agoSome people use bower as part of the stack and process I'm sure they have no problem locating the download link.
- oinksoft 13y ago1.2.0-rc1 landed three hours ago: https://github.com/angular/bower-angular/releases/tag/v1.2.0rc1 https://github.com/angular/bower-angular/releases/tag/v1.2.0... You should be able to specify this version as you do others in your bower.json.
- courtewing 13y agoThe release is ready to go for bower as of a few hours ago. Just use 1.2.x in your bower.json and it'll install the latest 1.2 release (which is this release candidate, currently). The same goes for angular-resource, angular-cookie, angular-scenario, and the newly created angular-route. They are all versioned along side the main library, so use 1.2.x as the version for all of them.
- Kiro 13y agoOT but what's the benefit of using bower? Just seems to complicate things.
- 13y ago
- leetrout 13y agoI'm very happy to see this dropping. Specifically the rewrite of ngAnimate and changing to saner (IMO) class conventions `.foo.ng-enter` and `.foo.ng-enter-active` instead of the previous use of `.foo-enter-setup` and `.foo-enter-start`.
- hammerha 13y agoSo, when can we use 1.2.0 stable? Any guess?
- troym 13y agoSeptember... 2012. See this thread (one of the longest on the mailing list atm): https://groups.google.com/forum/#!topic/angular/tqFZBkWPvl8 https://groups.google.com/forum/#!topic/angular/tqFZBkWPvl8 I know that doesn't answer your question directly; just wanted to point you to the existing discussion.
- dolphenstein 13y agoSipping on my morning coffee and reading HN. First Bootstrap RC2, and now AngularJS 1.2. I'm going to be busy over the next few days! :-)
- keda 13y agoInteresting enough, looks like there are changes to routeProvider that's causing injection to failed. Unfortunately, not a drop in replacement from 1.1.5. Anyone else experiencing same issue? Failed to instantiate module editor due to: Error: [$injector:unpr] Unknown provider: $routeProvider
- nateabele 13y agoNote: Shameless plug. :-) Now that the Angular core team has taken the step of moving the core routing infrastructure out into a separate library, I'd like to take this opportunity to recommend the unofficially-official alternative: https://github.com/angular-ui/ui-router/#ui-router https://github.com/angular-ui/ui-router/#ui-router
- troym 13y agoI avoided routing with Angular as long as I could because my initial attempts were.. shall we say, painful (and I blame me, not Angular). When I returned to the routing bits in my app, I picked up ui-router. It's such a nice library, I can't say enough good about it other than this: it should be in Angular core. I most appreciate nested routes and the state handling; the integration with ng-animate is just butter. Thank you!
- nateabele 13y agoThanks for the kind words. > I can't say enough good about it other than this: it should be in Angular core. Yeah, the core team have promised us that they'll be evaluating it for inclusion in 2.0.