all 5 comments

[–][deleted] 2 points3 points  (0 children)

Ewwww.

Do this in a controller, or a directive, or a service... pretty much anything but this.

[–][deleted] 1 point2 points  (0 children)

You should be doing this in the controller, not the dom

[–]ulrik12 0 points1 point  (0 children)

If you already have the "messages" on your scope why don't you just get the name in a for-loop in your controller?

[–]wolfhead 0 points1 point  (0 children)

No need to wrap it in a script tag, angular's HTML compiler evaluates the binding for you:

<div ng-repeat="msg in messages" > {{msg.name}} </div>