
AngularJS 1.2.0-rc1 released - patrickaljord
http://blog.angularjs.org/2013/08/angularjs-120-rc1-spooky-giraffe.html
======
tyre
Using 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.

~~~
yesimahuman
My favorite Angular doc page:
[http://docs.angularjs.org/api/ng.directive:ngModel](http://docs.angularjs.org/api/ng.directive:ngModel)

~~~
inglesp
This is mine: [http://docs.angularjs.org/guide/dev_guide.unit-
testing](http://docs.angularjs.org/guide/dev_guide.unit-testing)

------
jacques_chester
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.

~~~
hueyp
`ng-repeat` and `ng-include` work fine for recursive data structures.

[http://jsfiddle.net/uXbn6/378/](http://jsfiddle.net/uXbn6/378/)

~~~
jacques_chester
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.

~~~
hueyp
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)

~~~
jacques_chester
Here's the original article I took inspiration from:

[http://sporto.github.io/blog/2013/06/24/nested-recursive-
dir...](http://sporto.github.io/blog/2013/06/24/nested-recursive-directives-
in-angular/)

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

------
dolphenstein
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! :-)

------
nateabele
_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](https://github.com/angular-ui/ui-router/#ui-router)

~~~
troym
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!

~~~
nateabele
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.

------
rgbrgb
What's the best way to install this with bower?

~~~
revetkn
Actually, there is a faster way than bower!

1\. Download (or point to)
[https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/ang...](https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js)

2\. You're done

~~~
lucisferre
Some people use bower as part of the stack and process I'm sure they have no
problem locating the download link.

------
keda
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

~~~
zakj
Due to
[https://github.com/angular/angular.js/commit/5599b55b](https://github.com/angular/angular.js/commit/5599b55b),
you'll now need to explicitly include angular-route.js and add a dependency on
ngRoute.

~~~
keda
ah. cool. I remember seeing it somewhere. thanks for the tip.

------
sergiotapia
'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.

~~~
phaedryx
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?

------
leetrout
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`.

------
hammerha
So, when can we use 1.2.0 stable? Any guess?

~~~
troym
September... 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.

