Reading the ng-book, there is a part that suggest that when using the $scope
, try to wrap the attributes within another attribute, like this:
$scope.model.attribute
instead of $scope.attribute
According to the author this will be helpful if we have nested controllers as if we don't do it this way, if we were to change the value in the child $scope, it wouldn't go up to the parent.
I don't think I understand why is this necessary? What is the difference between $scope.model.attribute
and $scope.attribute
in terms of prototypal inheritance?