我有,我已經歸於形式角自定義表單驗證和指令
<form myValidations>
app.directive('myValidations', function(){
return{
//require: 'ngModel', note its commented out
link: function(s,e,a,ctrl){//note the emphasis on the ctrl
}
}
});
現在我將如何握這個CTRL $解析器,如果我沒有「需要自定義驗證指令:ngModel '爲我做。
我可以找到一個元素,然後在一些函數中調用它的ng模型返回一個ng模型控制器?這樣我可以從那裏#$解析器?
你能提供一個jsfiddle與你的相關代碼嗎? – odiseo 2013-03-14 00:24:47