Is it possible to achieve the automatic attribute binding functionality of an isolate scope:
scope : { someAttr: '@' }
While also maintaining the transparent scope-->parentScope property access as shown in scope.$new()
:
$scope.foo = 'foo';
$scope.bar = 'bar';
var childScope = $scope.new();
childScope.foo = 'childFoo';
// childScope == { foo: 'childFoo', bar: 'bar' }
Any ideas on how to create a new scope in the controller and pass attributes from a directive to that new scope?
Ultimately, I want my controller to look like:
$scope === {
attr : << attribute from directive instance >>
, parentKey : << transparent to parent directive's scope >>
}