More Related Content
Similar to Prototype and angularjs $scopes (10)
Prototype and angularjs $scopes
- 3. {
[prototype]:
color: black
}
myCar = new Car(‘black’)
{
[prototype]:
wheels: 4
color: gray
}
Car.prototype
Object.prototype
{
[prototype]: null
toString: function () ...
hasOwnProperty: function ...
}
color ? black
wheels ? 4
maxSpeed ? undefined
- 6. {
scope: false scope === $scope
}
{
scope: true -> child = $scope.$new(); child.__proto__ === $scope
}
{
scope: {} -> child = $scope.$new(true); child.__proto__ !== $scope
}