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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s