Interestingly enough - I sort of get the expected behavior with 
angular-1.0.7 with the isolated scope (isolatedProperty) but not with the 
two-way bounded scope (myParentProperty)

http://jsbin.com/kadaj/2/edit?html,js,output

Where as with angular 1.2, I get the expected behavior with the two way 
bounded scope (myParentProperty) but not with isolated scope 
(isolatedProperty) -

http://jsbin.com/kebub/6/edit?html,js,output<http://www.google.com/url?q=http%3A%2F%2Fjsbin.com%2Fkebub%2F6%2Fedit%3Fhtml%2Cjs%2Coutput&sa=D&sntz=1&usg=AFQjCNGeXnT_VaVnisiMkOPeCrd09ErAMQ>

Not quite sure how to explain this discrepancy.

On Wednesday, March 19, 2014 5:06:39 PM UTC-4, AngularN00b wrote:
>
> Hi Chris
>
> http://jsbin.com/kebub/6/edit?html,js,output
>
> Can you help me understand why the directive's isolatedProperty is being 
> inherited from the parent's scope?
>
> On Tuesday, March 18, 2014 5:22:38 PM UTC-4, Chris A wrote:
>>
>> You might try and include an example which does not use ng-init.  Check 
>> out the documentation for ng-init : 
>> http://code.angularjs.org/1.2.9/docs/api/ng.directive:ngInit
>> It might help your understanding of inherited scopes.  Also look at how 
>> prototyping in javascript works, it can be a little trick when working with 
>> inherited scopes and directives. 
>> https://github.com/angular/angular.js/wiki/Understanding-Scopes
>>
>> On Tuesday, March 18, 2014 11:32:03 AM UTC-5, AngularN00b wrote:
>>>
>>> Hi,
>>>
>>> I'm just beginning to learn AngularJS and I've been following various 
>>> books and tutorials. However, there seems to be some major changes around 
>>> how scope works with Angular 1.2 and a lot of the tutorials/explanations 
>>> out there don't seem to work as described.
>>>
>>> I've written a JS Bin that demonstrates the particular problem I'm 
>>> having -
>>>
>>> http://jsbin.com/hasupeho/4/edit?html,js,output
>>>
>>> As you can see, my directive is configured to have isolate scope. 
>>> However, only when I define a controller with myDirective does the isolate 
>>> scope actually work.
>>>
>>> Can someone please explain why this is?
>>>
>>> Thanks.
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to