AngularJS ng-view ng-view


ng-view is a directive used with $route to render a partial view in the main page layout. Here in this example, Index.html is our main file and when user lands on "/" route the templateURL home.html will be rendered in Index.html where ng-view is mentioned.

angular.module('ngApp', ['ngRoute'])

      templateUrl: "home.html",
      controller: "homeCtrl"

angular.module('ngApp').controller('homeCtrl',['$scope', function($scope) {
  $scope.welcome= "Welcome to stackoverflow!";

<body ng-app="ngApp">
    <div ng-view></div>

//Home Template URL or home.html