If I have a simple user status dropdown, such as:
<a class="dropdown-toggle">
{{userStatus}}
</a>
<ul class="dropdown-menu" role="menu">
<li data-ng-click="SwitchStatus('Online')"><i class="fa fa-circle text-green2 pr5"></i> Online</a></li>
<li data-ng-click="SwitchStatus('Busy')"><i class="fa fa-circle text-red2 pr5"></i> Busy</li>
<li data-ng-click="SwitchStatus('Away')"><i class="fa fa-circle text-orange2 pr5"></i> Away</li>
</ul>
And the controller has this:
var userStatuses = {
online: '<i class="fa fa-circle text-green2 pr5"></i>',
busy: "<i class='fa fa-circle text-red2 pr5'></i>",
away: "<i class='fa fa-circle text-orange2 pr5'></i>"
};
$scope.userStatus = userStatuses.online; // default online
Why does it inject the HTML into the page like this:
<a class="dropdown-toggle">
"<i class='fa fa-circle text-green2 pr5'></i>"
</a>
What can I do so that it injects it as an HTML element and not a string?
Also, it's obvious what I'm trying to achieve, and I have just started with angular, so feel free to point me in another direction. I want to eventually incorporate advanced logic when the different statuses are selected.
Thank you.