Add space to <select> with ng-options

前端 未结 1 1784
醉酒成梦
醉酒成梦 2020-12-31 17:15

How do I add leading spaces into the

EDIT

If you want to generate the   dynamically it is a little bit more complicated. Suppose you have a function in your controller that knows how many   you want to add, then you can write this function like this:

$scope.addSpaces= function(color){
    var count = 1;// put your logic here
    var result = "";
    for(var i=0; i

in your html it will be:


This works because we concatenate the unicode character for   (e.g.  ) in our string and not the entity, so there is nothing to escape for the element.text() function.

0 讨论(0)
提交回复
热议问题