What is an ng-view Directives?
The “ng-view” directive is used to switch between views in AngularJs.
The live view,
The “ng-view” directive is used to switch between views in AngularJs.
<!DOCTYPE html> <html lang="en"> <head> <title>Angular Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular-route.min.js"></script> <script > var myApp = angular.module("AngularApp",['ngRoute']); myApp.config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/', { templateUrl: 'test.html', controller: 'testCtrl' }) } ]); myApp.controller("testCtrl", function($scope){ $scope.model = { text:"This is the example of ng-view in angular js" } }); </script> </head> <body ng-app="AngularApp"> <ng-view></ng-view> </body> </html>
The live view,
Blogger Comment
Facebook Comment