OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Angular: conditional class with *ngClass

  • Thread starter Thread starter daniel
  • Start date Start date
D

daniel

Guest
What is wrong with my Angular code? I am getting the following error:

Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass

Code:
<ol>
  <li *ngClass="{active: step==='step1'}" (click)="step='step1'">Step1</li>
  <li *ngClass="{active: step==='step2'}" (click)="step='step2'">Step2</li>
  <li *ngClass="{active: step==='step3'}" (click)="step='step3'">Step3</li>
</ol>

<p>What is wrong with my Angular code? I am getting the following error:</p>
<blockquote>
<p>Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass</p>
</blockquote>
<pre class="lang-html prettyprint-override"><code><ol>
<li *ngClass="{active: step==='step1'}" (click)="step='step1'">Step1</li>
<li *ngClass="{active: step==='step2'}" (click)="step='step2'">Step2</li>
<li *ngClass="{active: step==='step3'}" (click)="step='step3'">Step3</li>
</ol>
</code></pre>
 

Latest posts

H
Replies
0
Views
1
Hür Doğan ÜNLÜ
H
Top