The default text in Angular is select

By default, angular uses a null value if nothing is selected in the <select> . How can I change this to text with Please select one text?

+6
source share
2 answers

You have not provided any code, so I cannot give an example regarding your code, but try adding an option element, for example.

 <select ng-model="item" ng-options="item.category for item in items" ng-change="doSomething()"> <option value="">Please select one</option> </select> 
+13
source

Using the ng-selected attribute:

 <select> <option>Hello!</option> <option ng-selected="selected">Please select one</option> <option>Another option</option> </select> 

Check out the link: https://docs.angularjs.org/api/ng/directive/ngSelected

+2
source

Source: https://habr.com/ru/post/982507/


All Articles