Pretty new to Angular and doing a small pilot project using Angular 5 and Visual Code. I am trying to use ng-include and the template doesn't get displayed.
src
add-device
add-device.component.html
add-device.component.scss
add-device.component.spec.ts
add-device.component.ts
edit-device
edit-device.component.html
edit-device.component.scss
edit-device.component.spec.ts
edit-device.component.ts
templates
device.html
app.module.ts
app.coponent.ts
app.component.html
....
simple device.html code
<div>Include is working!</div>
add-device.component.html
<div ng-include="" src="'templates/device.html'">
<div>More unique elements here!</div>
</div>
I also tried following
<div ng-include="" src="'templates/device.html'"></div>
<div ng-include="'templates/device.html'"></div>
Following gives error, ng-include is not recognized.
<ng-include src="'templates/device.html'"></ng-include>
Objective is to use device.html template code from both add and edit device components. I am using typescript to manage the project. When i look at the Sources in debugger, i do not even see device.html file in source list.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…