【发布时间】:2016-02-20 10:47:08
【问题描述】:
有类似的东西:
module.directive('myCustomInput', function($compile) {
return {
restrict: 'E',
template: '<input ng-model="$scope.myVar"></input>'
}
}
这不绑定到模型,我可以让它工作的唯一方法是在范围内指定一个变量:{},然后使用它,这实际上是我不想要的。
有什么解决办法吗?
【问题讨论】:
标签: angularjs angularjs-directive angularjs-scope angularjs-ng-model