0
在一個角度指令中,您可能需要form^AND ngModel?是否可以在鏈接功能中訪問窗體和控制器?Angular指令 - 要求ngModel AND表單^
angular.module('myApp')
.directive('passwordValidation', passwordValidation)
function passwordValidation(){
return {
replace: true,
require: 'ngModel', // also 'form^' ?
scope: {
userName: '@'
},
link: function(scope, elem, attr, ctrl, form) {
...
哈哈,我實際上試過,但是錯誤地有'形式^'。謝謝! – neridaj