0
我試圖創建選擇/下拉列表的包裝指令......但不能將ngRepeat傳遞給指令傳球NG-重複的指令
return {
scope: { options: '=', ngModel: '=', ngRepeat: '=', textField: '@', valueField: '@' },
required: ['ngModel', 'ngRepeat', 'textField', 'valueField', '^form'],
restrict: 'E',
compile: compileFunction,
};
和相應的HTML是:
html += '<select data-ng-model="ngModel" name="myfield" >' +
' <option value=""></option> ' +
' <option data-ng-repeat="ngRepeat" value="valueField">{{textField}}</option>' +
'</select> ';
,但得到的錯誤:
Expected ngRepeat in form of '_item_ in _collection_[ track by _id_]' but got 'ngRepeat'.
任何想法,爲什麼???
編輯 PLUNKER LINK
增加了plunker鏈接
@DavinTryon試圖..但不工作.. btw添加plunker鏈接 – harishr
有人可以請幫我這個 – harishr