Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Set width using [ngStyle]

$
0
0

@dipankar123 wrote:

hi guys can i set width using [ngStyle]?
i have a div and i want to set it’s width using [ngStyle]. can i do that?
changing background color using ngStyle working

here is my code:
page.html:

<div id="mydiv" [ngStyle]="{'background-color': divColor; 'width': divWidth}"></div>

page.ts:

  divColor: string;
  divWidth: any;

constructor(){
     this.divColor = 'rgb(34, 34, 34)';
    this.divWidth = 10;
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>