I've finally decided to give angularjs a whirl and i'm running into some early trouble.
I'm using Rails 3.2 and the Slim template gem for the view.
I'm just trying the example from the angularjs site here: http://angularjs.org/#todo-html
Here's the relevant bit:
<div ng-controller="TodoCtrl">
<span>{{remaining()}} of {{todos.length}} remaining</span>
Which in slim would be something like:
div(ng-controller="TodoCtrl")
span {{remaining()}} of {{todos.length}} remaining
The problem is Slim just prints:
{{remaining()}} of {{todos.length}} remaining
literally as a string.
Anyone able to get Slim and Angular to play together?
I finally got it to work.
I had to go into my layout and do this:
html(ng-app='')
You can probably add that to a div on the particular page also.
div(ng-app='')
div(ng-controller="TodoCtrl")
span {{remaining()}} of {{todos.length}} remaining
Hopefully this helps someone. It took me a bit to figure out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With