View components in AngularJS
AngularJS supports Single Page Application through multiple views on a single page. To do this, AngularJS provides ng-view and ng-template directive and $ routeProvider service.
Introducing ng-view in AngularJS
The ng-view tag is simply created where the corresponding view screens can be placed in it based on the configuration.
Using
Define div tags with ng-view in the main module.
ng-app = "ungdungAngularJS" > .ng-view >Ng-template introduction in AngularJS
ng-template directive is used to create HTML views using script tags. It contains the " id " attribute used by $ routeProvider to link the view and controller.
Using
Define a script block with ng-template type in the main module.
ng-app = "ungdungAngularJS" > .