In this example of Ng-Controller
, We are taking two controller on two different html code blocks so the scope will be limited to their respective controllers. In the example we have controllers like: var app = angular.module('myApp', []); app.controller('myCtrl1', function ($scope) { $scope.firstName = "Learn"; }); app.controller('myCtrl2', function ($scope) { $scope.lastName = "kode"; }); And HTML part is like :