Please let me know if you need more information or want me to clarify anything. I have tried a lot of different things to figure this out but haven\'t found a solution.
Since the textbox in the directive uses a primitive instead of an object for its model (ng-model="value"
rather than ng-model="someobj.somevalue"
), its model is created only on the local scope and the parent does not have access to it.
The fix is to define the directive textbox model using the dot rule as an object property:
ng-model="value.firstname"
Then pass the whole user
object into the directive instead of just the primitive property:
Here is a demo