Why doesn't a directive with an isolate scope apply the scope to it's DOM element?
问题 I'm trying to figure out how AngularJS scopes work. I'm also curious why they work the way they do. I think the following behavior doesn't make sense (fiddle 1). <div ng-app="app"> <p>outer element's scope: {{$id}}</p> <custom-directive isolate-value="Hello!"> <p>inner element's scope: {{$id}}</p> <p>isolate value: {{isolateValue || 'undefined'}}</p> </custom-directive> </div> function Directive() { return { restrict: 'E', scope: { isolateValue: "@" }, link: function(scope, element,