我有角角模板指令不能正常工作
when('/customers', {
//templateUrl: 'customers.html'
controller: 'ListController'
, template: "<h1>{{customers}}</h1>"
})
这个工程这条路线,它显示properly.i决定去大一点的
when('/customers', {
//templateUrl: 'customers.html'
controller: 'ListController'
, template: "<div class=\"navigation-section\" id=\"customers\">\r\n <div class=\"section\">\r\n <div class=\"text-input-container card\"> <i class=\"icon-search text-input-icon\"><\/i>\r\n <input type=\"text\" class=\"text-input \" placeholder=\"Search\" ng-model=\"query1\" \/> <\/div>\r\n <div> <\/div>\r\n <\/div>\r\n <div class=\"section\">\r\n <ul class=\"list\">\r\n <li ng-repeat=\"customer in customers | filter:query1 | orderBy:[\'customer.information.name\',\'customer.information.phone\']\" ripple>\r\n <a href=\"#\/customer\/{{customers.indexOf(customer)}}\"><\/a>\r\n <button class=\"icon-button\"><i class=\"icon-account-circle\"><\/i><\/button> <span class=\"item-text\">\r\n\t\t\t{{customer.information.name}}\r\n\t\t\t<span class=\"secondary-text\">\r\n\t\t\t\t{{customer.information.phone}}\r\n\t\t\t<\/span> <\/span> <i class=\"icon-message item-action\"><\/i> <\/li>\r\n <\/ul>\r\n <\/div>\r\n<\/div>"
})
这并不工作,为什么?
什么不行?模板不加载吗?插值不工作?控制台中是否有错误? –
更好的是,把它放到html文件中并使用'templateUrl',恭喜,不需要转义所有的html。 – KreepN