AngularJS 1.4.0-rc.2 ngOptions 禁用时

AngularJS 1.4.0-rc.2 ngOptions disable when

好的,所以我决定做一个预发布 Angular 以利用 ngOptions 中的新 "disable when"。我不确定我可以 fiddle 使用的范围。这是按预期工作的代码,删除了一个变量:

        <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>

所以我的问题是:我可以访问 "disable when" 内部的范围吗?如果我这样做,我做错了什么?

我决定向父元素添加一个 ng-repeat 语句,从而需要明确定义范围。现在是:

        <select ng-model="loan.BorrowerId" ng-options="person.Id as (person.LastName + ', ' + person.FirstName) for person in Persons" class="form-control"></select>{{BorrowerId}}

        <select multiple ng-model="loan.CoBorrowerIds" ng-options="person.Id as (person.LastName + ', ' + person.FirstName) disable when (person.Id==loan.BorrowerId) for person in Persons" class="form-control"></select>

...而且效果很好。这可能是一个错误,或者我的想法不佳。然而,不管怎样,答案还是有的!