我在HTML这样的代码:无法访问范围值
<div ng-if="item.shareText">
<textarea></textarea>
<div>
<select ng-model="shareOptions">
<option value="PUBLIC" selected>public</option>
<option value="FOLLOWERS">followers</option>
<option value="INDIVIDUAL">individuals</option>
</select>
<div ng-if="shareOptions == 'INDIVIDUAL'">
<div
isteven-multi-select
input-model="userFriends"
output-model="outputUserFriends"
button-label=" icon fullName"
tick-property="ticked">
</div>
</div>
</div>
</div>
在控制器:
if($scope.shareOptions == 'INDIVIDUAL' && $scope.outputUserFriends.length == 0){
$window.alert("Please select your INDIVIDUALS");
return;
}
这里outputUserFriends是示出了长度为未定义。为什么?
你写过的任何指示?如果是的话,请将其发布。如果没有,那么你如何期望outputUserFriends反映范围 –
自定义该指令@nikhil – Ajay