Reputation: 9247
I have this input field that is black.
<input class="form-control input-sm bg-light-black white" style="border:1px solid #1d1d1d;" ng-model="gameType" ng-init="gameType='@Translator.Translate("ALL")'" ng-model-options="{ debounce: 500 }">
I made it that looks like dropdown so i want to disable option that user can click on it and enter something.I tryed with ng-disabled but it changes colour to gray.Any suggestion?
Upvotes: 1
Views: 6902
Reputation: 1581
ng-disabled
will add the html-attribute disabled
to the <input>
-field which is displayed in a greyish way then. I think this is what you probably want. You could tweak the css of the <input>
field for the disabled state via css then:
input, input:disabled {
background: #cff;
/* custom style */
}
And to be complete, the html:
<input type="button"><br>
<input type="button" disabled><br>
<input type="button" ng-disabled="someTruthyExpression">
Upvotes: 2
Reputation: 15901
Try ng-readonly to disable input
https://docs.angularjs.org/api/ng/directive/ngReadonly
EDIT
Use <input readonly="readonly" ...
if the value stays the same.
Upvotes: 4
Reputation: 156
here is the solution for your query,
<input type="text" ng-readonly="checked" value="I'm Angular" aria-label="Readonly field" />
Upvotes: 0