rlsaj
rlsaj

Reputation: 735

AngularJS ngclass, remove class if state exists

I have the following body tag

<body class="loaderParent" ng-class="">

how do I remove the loaderParent class if $state.includes('home') ?

Upvotes: 0

Views: 1698

Answers (2)

JB Nizet
JB Nizet

Reputation: 691705

<body ngClass="{loaderParent: !$state.includes('home')}">

Why don't you read the documentation?

Upvotes: 2

AJcodez
AJcodez

Reputation: 34166

You can put an object in ng-class like so:

<body ng-class="{ loaderParent: callControllerMethod() }">

Upvotes: 1

Related Questions