AngularJS 1.2.0-rc1 released(blog.angularjs.org)
blog.angularjs.org
AngularJS 1.2.0-rc1 released
http://blog.angularjs.org/2013/08/angularjs-120-rc1-spooky-giraffe.html
9 comments
I 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.
My favorite Angular doc page: http://docs.angularjs.org/api/ng.directive:ngModel
Funny 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).
It's not the best but I've actually not had too much trouble with the docs. I found the trick is to read the guides first, once you understand the principles that Angular.JS works on the terse reference docs are much more approachable.
A little linking would go a long way though. For example that ngModel page really needs to link to NgModelController!
A little linking would go a long way though. For example that ngModel page really needs to link to NgModelController!
am I the only one that has never had an issue with angular's docs? :P
You might well be.
Likely. 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
Luckily, I've found the source code to be very readable and easy to understand, which isn't something I can say about a lot of JavaScript libraries.
I 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.
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.
`ng-repeat` and `ng-include` work fine for recursive data structures.
http://jsfiddle.net/uXbn6/378/
http://jsfiddle.net/uXbn6/378/
I 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.
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.
Can 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)
Here's the original article I took inspiration from:
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
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://github.com/eu81273/angular.treeview
Edit: I guess what I wished for would be something like this --
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
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://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.This 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.
Sipping 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! :-)
Note: 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
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
I 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!
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!
Thanks 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.
> 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.
What's the best way to install this with bower?
1.2.0-rc1 landed three hours ago: 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.
You should be able to specify this version as you do others in your bower.json.
Actually, there is a faster way than bower!
1. Download (or point to) https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/ang...
2. You're done
1. Download (or point to) https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/ang...
2. You're done
Some people use bower as part of the stack and process I'm sure they have no problem locating the download link.
[deleted]
The 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.
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.
OT but what's the benefit of using bower? Just seems to complicate things.
Single command line retrieval of dependencies, single command line to update them. And you don't have to remember the exact git url.
Interesting 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
Failed to instantiate module editor due to: Error: [$injector:unpr] Unknown provider: $routeProvider
Due to https://github.com/angular/angular.js/commit/5599b55b, you'll now need to explicitly include angular-route.js and add a dependency on ngRoute.
ah. cool. I remember seeing it somewhere. thanks for the tip.
'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.
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.
In 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?
Actually, `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.
I'm pretty sure Angular uses these funky release names sarcastically.
I'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`.
So, when can we use 1.2.0 stable? Any guess?
September... 2012. See this thread (one of the longest on the mailing list atm): 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.
I know that doesn't answer your question directly; just wanted to point you to the existing discussion.
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.