I\'m writing an directive which needs an isolated scope, but I want to bind it to the parent scope via ngModel.
Here the problem is that the parent\'s scope value is
the first answer explains the problem well, I believe i have a simpler solution that avoids extra watches.
to summarize answer 1. ngModel can not work inside the isolate scope because the elements you intended it to bind to are not in its scope. they are in the parent scope.
solution 1, bind to the parent's property
Change me!
becomes
Change me!
solution 2, move ngModel outside the isolate scope
require : '?ngModel',
becomes require : '?^ngModel',
the ^ tells your directive to look in parent elements for ngModel
Change me!
becomes
Change me!