Reputation: 1708
Having something like:
module.directive('myCustomInput', function($compile) {
return {
restrict: 'E',
template: '<input ng-model="$scope.myVar"></input>'
}
}
This does not bind to the model, the only way I can make it to work is by specifying a variable in the scope: {}, and then use it, which is what actually I don't want.
Is there any solution?
Upvotes: 0
Views: 48
Reputation: 25352
You don't need to mention $scope
in view
Try like this
<input ng-model="myVar"></input>
Upvotes: 1