У меня есть шаблон углового шаблона
script(type="text/ng-template" id="signalthread_template")
.dp_wrapper
.dp.ph(style='position:absolute;left:10px;top10px;width:40px;height:40px;')
img.mw.inline_top(src='')
.message(style='padding-left: 50px;')
.n(style='margin-top: -3px;')
span.bold Name here
span , Title here
У меня есть этот ng-repeat
.message_wrapper.content_inner_content.p10(ng-repeat='message in [{type:"signalthread"}, {type:"jobthread"}, {type:"jobthread"}]' style='min-height:50px;')
p {{message.type}}
.include(ng-include src="'signalthread_template'")
Параграф печатает правильное имя шаблона нити. Но ng-include пытается сделать http-вызов для шаблона, который не существует.
Где я иду не так?
Согласно документам (https://docs.angularjs.org/api/ng/directive/ngInclude), src ожидает, что угловое выражение оценивается по URL-адресу. Вы можете сохранить ваш шаблон в отдельный html файл, а затем использовать имя файла для src
ng-app
/bootstraped
иначе эти шаблоны не будут скомпилированы ...