passing a variable to the width style div angular

Solutions on MaxInterview for passing a variable to the width style div angular by the best coders in the world

showing results for - "passing a variable to the width style div angular"
Isabel
02 May 2020
1@Component({
2  selector: '[sidebar]',
3  templateUrl: 'app/Nav/sidebar.comp.html',
4  host: {
5    '[style.height.px]':'0.9 * height',
6    '[style.width.px]':'0.21 * width'
7  }
8
9})
10
11export class SidebarComp {
12    width: number;
13    height: number;
14
15    constructor() {
16        this.height = window.innerHeight;
17        this.width = window.innerWidth;
18    }
19}
20
Imran
13 Jul 2016
1<img [src]="imageUrl | safe: 'url'" [ngStyle]="{width: imagewidth, height: imageheight}">
2