1
禁用時,AngularJS 1.4.0-rc.2禁用,所以我決定我要做一個預發佈的Angular來利用ngOptions中新的「disable when」。我不確定我被允許擺弄的範圍。下面是代碼按預期一個varable取出時運作:AngularJS 1.4.0-rc.2當
<select multiple ng-model="CoBorrowerIds" ng-options="person.Id as (person.LastName + ', ' + person.FirstName) disable when (person.Id==1) for person in Persons"></select>
ID爲1的陣列被禁用。然而,我有這個代碼不起作用:
<select ng-model="BorrowerId" ng-options="person.Id as (person.LastName + ', ' + person.FirstName) for person in Persons"></select>
<select multiple ng-model="CoBorrowerIds" ng-options="person.Id as (person.LastName + ', ' + person.FirstName) disable when (person.Id==BorrowerId) for person in Persons"></select>
所以我的問題是:我有權訪問「禁用時」內的範圍?如果我這樣做,我做錯了什麼?