Display AngularJs ng-template directly

Possibly save 1 hour of your time: There may be times when you want to display an Angular template directly. You can use ng-include and single quote around the path to the file:

<div ng-include src="'views/sidepanel.html'" ng-controller="SomeController"></div>

You can also specify the controller using ng-controller.

Book: AngularJS: Up and Running: Enhanced Productivity with Structured Web Apps

Leave a comment