I am using AngularJS and bootstrap badges with some embedded glyphicons to display some category information.
When I include the glyphicon in the badge, the text lies a little too close to the glyphicon for my liking.
I have created an Angular JS function to append this white space to the badge text like so:
$scope.getWhiteSpace = function() {
return " " + $scope.category;
}
However, when I try to include whitespace/blankspace (or whatever the correct term is...) in front of the text, the badge seems to automatically strip it. I need to do it using an angular function because I want to be able to decide if I want the whitespace or not, dependent on whether there is a glyphicon present in the badge.
The only way i've been able to get the effect I want is to include in the html like so:
<span class="badge">
<span class="glyphicon glyphicon-plus-sign"></span>
{{category}}
</span>
What is the correct way to do this using a function? Or is there a simple CSS fix? [I have dabbled unsuccessfully - I am new to this stuff....]
Here is a plnkr which shows what is happening: http://plnkr.co/edit/bCIA8Lw9x2bWzIA55GIP