у меня есть этот маршрут в угловомугловая директива шаблон не работает
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', congrats, не нужно избегать всего этого html. – KreepN