I have a Component which update css class
.slider-horizontal {
width: 210px;
height: 20px;
}
import {Component, OnInit, Input, ViewChild, ElementRef, Renderer} from '@angular/core'; export class SliderComponent implements OnInit { @ViewChild('picker') picker: ElementRef; constructor(private renderer: Renderer, private el: ElementRef) { } ngAfterViewInit() { this.renderer.setElementClass(this.picker.nativeElement, 'slider-horizontal', true); console.log(this.picker.nativeElement.offsetWidth);//old value console.log(this.picker.nativeElement.offsetHeight);//old value } }
How do I get the new values which are changed after apply css?