I have created an application in AngularJS with a drop down with space in option using a filter. The application is working fine but the
which I have put for space is not getting compiled.
My code is as given below
html
<select>
<option ng-repeat="(key, value) in headers">{{value | space}}
</option>
</select>
script
app.filter('space', function() {
return function(text) {
if(_.isUndefined(text.mainId))
{
console.log('entered mainId');
return text.value;
}
else
{
console.log('entered');
return ' '+text.value;
}
};
It works by giving the unicode value for
.
app.filter('space', function() {
return function(text) {
if(_.isUndefined(text.mainId))
{
console.log('entered mainId');
return text.value;
}
else
{
console.log('entered');
return '\u00A0\u00A0\u00A0'+text.value;
}
};