Angular ng-view Directive

What is an ng-view Directives?

The “ng-view” directive is used to switch between views in AngularJs.

<!DOCTYPE html>
<html lang="en">
    <title>Angular Demo</title>
    <script src=""></script>
    <script src=""></script>
    <script >
        var myApp = angular.module("AngularApp",['ngRoute']);
            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"

<body ng-app="AngularApp">

The live view,

About Blogger


Hey! I am Anil Singh. I am Active Blogger, Writer and Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...

    Blogger Comment
    Facebook Comment
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book