The problem of using angles with thin in rails project

I finally decided to give angularjs a whirlwind, and I ran into some early troubles.

I am using Rails 3.2 and a line template stone for presentation.

I'm just trying to give an example from the angularjs website: http://angularjs.org/#todo-html

Here's the corresponding bit:

 <div ng-controller="TodoCtrl">
   <span>{{remaining()}} of {{todos.length}} remaining</span>

In slim there will be something like:

div(ng-controller="TodoCtrl")
  span {{remaining()}} of {{todos.length}} remaining

The problem is that Slim just prints:

{{remaining()}} of {{todos.length}} remaining

literally like a string.

Can anyone get Slim and Angular to play together?

+5
source share
2 answers

I finally got him to work.

I had to go into my layout and do this:

html(ng-app='')

Perhaps you can also add this to a div on a specific page.

div(ng-app='')
  div(ng-controller="TodoCtrl")
    span {{remaining()}} of {{todos.length}} remaining

, -. .

+11

:

html [ng-app]

:

div [ng-app]
  div [ng-controller="TodoCtrl"]
    span {{remaining()}} of {{todos.length}} remaining
+6

All Articles