情况:
我有一个属性指令,将它的元素包装到模板中。这里是:
app.directive("myCustomInput", function(){
return{
restrict: "A",
replace: true,
scope:{},
transclude: "element",
template: "<div class='input-wrap'>"+
"<div ng-transclude></div>"+
"<i class='glyphicon glyphicon-chevron-down'></i>"+
"</div>"
}
});
我像这样使用它:
<input my-custom-input ng-model="data.input" type="text" />
问题:
ng-model
不工作
这是plunker