I have some very simple Angular code which looks like this…
<div ng-repeat="message in data.messages" ng-class="'conversationCard-' +
message.type"></div>
It works, but the resulting output looks like this….
<div ng-repeat="message in data.messages" ng-class="'conversationCard-' +
message.type" class="ng-scope conversationCard-phone"></div>
The problem is that my class now starts with ng-scope which is breaking my css selector which looks like this..
[class^="conversationCard"]
Is there any way of getting angular to remove the ng-scope, or at the very least put it at te end of the class declarations?
It shouldn’t matter if you wanted to access that class via css:
I’m not sure why you’re using the ability to specify attributes in your css for classes, the method I’ve described is the common way of doing it. Can you perhaps elaborate on why you’re using the attribute selector?
Edit
Change your html to
So that processed it becomes
So in your css you can do
And if you want to isolate the phone one: