我遇到了ng-disable的问题.因为我使用棱角分明的材料我觉得这不起作用.我希望根据条件动态禁用或启用输入框.
注意: – 我有多个输入字段我想要禁用或一次性启用所有输入.
我这样想
<md-input-container class="md-block" flex-gt-sm> <label for="Autocomplete">From</label> <input required type="text" class = "hideShadow" ng-model="FromLocation" uib-typeahead="state for state in states | filter:$viewValue | limitTo:8" class="form-control" ng-disabled="isDisabled"> <div ng-messages="searchFlight.FromLocation.$error"> <div ng-message="required">Please enter from location</div> </div> </md-input-container>
我试图像这样动态访问ng-disabled =“isDisabled”
$scope.isDisabled = true;
但这不起作用.我可以知道我哪里错了吗?