Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Is there a way to replace a class using renderer2 in angular

I am using angular 10 and using Renderer2 to add and remove classes:

this.renderer.removeClass(this.document.body, 'signin-user');
this.renderer.addClass(this.document.body, 'anonymous-user');

Does Renderer2 let me replace a class. For e.g if "signin-user" is applied replace it with "anonymous-user" and vice-versa instead of writing the removeClass function.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

this.renderer2.addClass(element, 'className');
this.renderer2.removeClass(element, 'className');

You can check this out here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!