Thursday, March 12, 2015

ng-view vs ng-include directive

Both the ng-view and ng-include directives are used to plug in content to the main html page.

The ng-include directive is more like a static content addition to the main page, while using this directive the page / content to be included in the main page is defined in the main .html page. This directive can be used when we want to include static content like top-menu, left-menu, header, footer, disclaimer etc to the main page.

The ng-view directive allows dynamic content addition to the parent page based on the URL provided by the end user, this directive helps in implementing routing feature similar to Asp.Net MVC routing, the behavior of the page will vary based on the URL requested by the end user. This directive can be used to add dynamic content to the page, like master-child, list-details content based on requests provided by the end user.

To learn more about these directives, refer to the following posts.

ng-view
ng-include


Search Flipkart Products:
Flipkart.com

No comments: