I have a problem with Angular and Jade. I have my index.jade that it looks like this:
extends ../layouts/default
block content
script(type='text/javascript', src='/js/angular.js')
script(type='text/javascript', src='./controllers.js')
ul(ng-controller='PhoneListCtrl')
li(ng-repeat='phone in phones')
{{phone.name}}
p {{phone.snippet}}
and my angular controller which looks like this:
'use strict';
/* Controllers */
function PhoneListCtrl($scope) {
$scope.phones = [
{"name": "Nexus S",
"snippet": "Fast just got faster with Nexus S.",
"age": 0},
{"name": "Motorola XOOMâ„¢ with Wi-Fi",
"snippet": "The Next, Next Generation tablet.",
"age": 2},
{"name": "MOTOROLA XOOMâ„¢",
"snippet": "The Next, Next Generation tablet.",
"age": 1}
];
}
And my problem is when I run the code the bindings in the index.jade don't work. So i'm kind of lost because I don't know why. Thanks for your help
script
part of the code in the template to the bottom of the template - that is move the code such that it is the last code in the template. Check if this works. – callmekatootie yesterday