Need some help with styling an angularjs ng-option.
I want it to look like this:
So I have the ng-option like this.
<select ng-options="servicepoint.id as servicepoint.name+' '+servicepoint.routeDistance+' m' for servicepoint in $ctrl.servicepoints">
</select>
This result in this:
So do you guys know if I can style just the last part with the meters to a blue color and make an ellipse if text is to long. The distans should be visible all the time.
It seems like <option>
can't have <span>
-tags or stuff like that so I can style the text?
I was trying to put the option out in an ng-repeat and style it there but no success.
<select>
<option ng-repeat="service in $ctrl.servicepoints">
<span>{{service.name}}</span><span style="color: blue">{{service.routeDistance}} m</span>
</option>
</select>
Anyone that can guide me in the right direction?
Unfortunately, here is a full response from what I gathered, I wish I found a simpler hack around it but these are the facts:
Solution:
There are replacement plug-ins that look like a but are actually composed of regular HTML elements that CAN be styled. This is where you should begin your search.
For further explanation: this text
The text is decent I read through it, tackles the problem from discovery to solution phase.