AngularJS: spaces in <option> value attr with ng-repeat
See original GitHub issueFrom https://github.com/yeoman/generator-angular/issues/1052
My controller has
$scope.opts = [
"opt1",
"opt2",
"opt3",
"opt4",
"opt5"
];
$scope.opt = "opt1";
The view is like the following
<select ng-model="opt">
<option value="">...</option>
<option ng-repeat="option in opts">{{option}}</option>
</select>
Using grunt serve
there are no problems and the result is:
When I run grunt build
the result is
<select>
<option value="">...</option>
<option value="opt1 ">opt1 </option>
<option value="opt2 ">opt2 </option>
<option value="opt3 ">opt3 </option>
<option value="opt4 ">opt4 </option>
<option value="opt5 ">opt5 </option>
</select>
White spaces? Why?
Issue Analytics
- State:
- Created 8 years ago
- Comments:6
Top Results From Across the Web
Additional spaces in angularjs select option - Stack Overflow
Try to put your code in one line. Something like that : <select name="recName" ng-model="newMessage.recName"> <option ng-repeat="player in ...
Read more >Angular ng-options Directive - W3Schools
The ng-options directive uses an array to fill the dropdown list. In many cases it would be easier to use the ng-repeat directive,...
Read more >ngRepeat - AngularJS: API
The ngRepeat directive instantiates a template once per item from a collection. Each template instance gets its own scope, where the given loop...
Read more >How to filter ng-repeat values according to ng-model using ...
The ng-repeat values can be filtered according to the ng-model in AngularJS by using the value of the input field as an expression...
Read more >Top 18 Most Common AngularJS Developer Mistakes - Toptal
In this article you will learn about most common AngularJS developer mistakes and how ... There are two ways, in both of them...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m facing the same problem.
This should now be fixed in
1.2.0
on npm. If any of you still encounter the problem please reopen this issue.