1

I'm trying to override only a part of my default class (glyphicon-eye-...).

With this code :

<i [class.glyphicon-eye-open] = "isOpen" class="glyphicon glyphicon-eye-close"></i>

I get class = "glyphicon glyphicon-eye-close glyphicon-eye-open"

How can i get this instead class="glyphicon glyphicon-eye-open" ?

1 Answer 1

1

Use the ng-class instead

<i [ngClass]="{'glyphicon-eye-close': !isOpen, 'glyphicon-eye-open': isOpen}" class="glyphicon"></i>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.