What is the difference between ng-include and ngroute in angularjs

I just started with angularJs web application using html. I want to know about the difference between ng-include and ngroute in angularjs, and also when I should use them. If anyone can know this, please give me an example to find out.

Thanks and greetings, Party

+4
source share
2 answers

ng-includecalled directiveangular, its basic concept in angular. It allows you to include partialhtml files on your page.

ng-route - , angular, routing URL . , dependency.

angular.module("app", ["ngRoute"]);

:

  • one angular routing built-in, .
  • ng-include <div data-ng-include="..."></div>
  • ng-route JavaScript.
+2

ng-include html DOM.

ng-route , . , URL- .

. ng-view. URL-, .

+3

All Articles