Partial views in AngularJS Partial views in AngularJS angularjs angularjs

Partial views in AngularJS


there are couple ways for partials in AngularJS.

ng-include

If theres no logic, or it will be provided from parent scope you can just include a html file into your view.

Example:

<div ng-include="'/path/to/your/file.html'"></div>

new directive

If you'll have a bit logic in your partial, and you'd like to use it as a separate module in your app - I'll strongly advice to built a new directive.

Example.

PS. If you're new to Angular, this may be useful :-)