AngularJS Angular $scopes Basic Example of $scope inheritance


angular.module('app', [])
.controller('myController', ['$scope', function($scope){
    $scope.person = { name: 'John Doe' };

<div ng-app="app" ng-conroller="myController">
    <input ng-model="" />
    <div ng-repeat="number in [0,1,2,3]">
        {{}} {{number}}

In this example, the ng-repeat directive creates a new scope for each of its newly created children.

These created scopes are children of their parent scope (in this case the scope created by myController), and therfore, they inherit all of its proporties, such as person.