Angularjs directive isolated scope and impact in the parent scope -
there behaviour isolated scope in directives , = attribute don't understand.
i have directive isolated scope , 2 attributes in :
scope: { attr1: '=', attr2: '=' }
maybe wrong i'm expecting modifications of attr1 , attr2 objects in directive's template transmitted original object.
for exemple :
<directivename attr1="anobject" attr2="anotherobject" />
i'm expecting modifications on attr1 , attr2 in directive available in 'anobject' , 'anotherobject' doesn't seem case.
but have notice if add level anobject , anotherobject
<directivename attr1="foo.anobject" attr2="foo.anotherobject" />
then modifications in directive's template of attr1 , attr2 transmitted $scope.foo.anobject , $scope.foo.anotherobject.
can explain me why , tell me way force transmission of modifications directive original objects without having force caller of directive add intermediate level between $scope , object.
thank :)
i'm going guess using primitive attribute value rather object. if so, seeing overwriting of primitive child scope. see post details (especially 2nd answer):
Comments
Post a Comment