AngularJS tip, quote your css classnames in ng-class

It is a common practice to use spinalcase in CSS, like the css class “.ada-wizard-marker”.

If you want to use this class in a ng-class directive, where the input is an object, use single quotes, like:

ng-class="{ 'ada-wizard-marker': vm.showToolTip }"

If you don’t use the single quotes, ng-class will not work.

Leave a Reply

Your email address will not be published. Required fields are marked *