Assigns a value to a property of the current scope specified via property_chain
. Unlike in
JavaScript, if there are any undefined
intermediary properties, empty objects are created
and assigned in to them instead of throwing an exception.
var scope = angular.scope(); expect(scope.person).toEqual(undefined); scope.$set('person.name', 'misko'); expect(scope.person).toEqual({name:'misko'}); expect(scope.person.name).toEqual('misko');
.
(dot), e.g. 'person.name.first'