AngularJS: ngInclude vs directive
问题 I do not quite understand when to use a directive and when it would be more appropriate to use nginclude. Take this example: I have a partial, password-and-confirm-input-fields.html , that is the html for entering and confirming a password. I use this both under signup-page and under change-password-page. Those two pages has a controller each, the partial html has no dedicated controller. Should I use directive or ngInclude for this? 回答1: It all depends on what you want from your code