I have two directives a wrapper with common values and a inner directive, in the controller i have a object element
in the template i have
<div wrapper="element">
<div inner="name"></div>
<div inner="lastname"></div>
</div>
Example: I want bind element.name property from inner directive, inner directive its a complex widget
i trying to access to element from inner through wrapper, how i can achieve it?
wrapper directive
{
scope: {
wrapper: '='
}
}
inner directive
{
require: '^wrapper',
scope: {
inner: '@'
}
}
in the inner directive template
<input type="text" ng-model="$parent.wrapper[inner]" />
Not working!
Note: i dont want set for each inner directive the model, Example
<div wrapper="element">
<div inner="name" model="element.name"></div>
<div inner="lastname" model="element.lastname"></div>
</div>
innerthrough wrapper ifinneris already the current scope?