S
S
Sergey2015-11-09 16:46:30
Angular
Sergey, 2015-11-09 16:46:30

Add class in angularjs?

There is a popup window

<div class="cd-popup" ng-if="showFon" ng-click="clickToFon($event)">
  <div class="window">
    <p>asd</p>
  </div>
</div>

There is an .active class that, when added to .cd-popup , displays a popup. Task:
If showFon === true, then first display the .cd-popup block. and then add .active
I don’t understand how to add active after working out ng-if

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-09
@Sergamers

<div ng-class="{'active': showFon}">
in general, I don’t see the point in doing anything else if the class activeshould be hung on the element always when it works for ng-ifyou ... just add this class. Until the condition is met, the element will be removed from the DOM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question