Answers for "how to add style in angular"

0

ng style

<some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
Posted by: Guest on January-02-2021
0

css code in angular

content_copy
      
      :host {
  display: block;
  border: 1px solid black;
}
Posted by: Guest on February-02-2021
0

ng-style

<input type="button" value="set color" ng-click="myStyle={color:'red'}">
<input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
Posted by: Guest on October-21-2020

Browse Popular Code Answers by Language