angular style
style binding
showme:boolean:true
this.showme=!this.showme
NgStyle:--
ngStyle directive to set style properties to dom element
we can pass dynamic value via variable
ex:--
<div [ngStyle]="background-color:value'>example</div>
ex:---
tsfile:
htmlfile
we can pass more then one value..
ngClass:---
set a class name for the element
we can pass dynamic values via variables
1.ng class with string,array,object
2.ng class with component based method
example:--
<div [ngClass]="'one'">using string</div>
<div [ngClass]="{'one':true,'two:false}">with multiple class</div>
static
html file:--
css file:--
dynamic
ts file
css file
morethenoneclass:--
ts:
css:
with expression:--
with only css file
Data binding:---
bind the data from view[template] to controller and vice versa
interpolation:--ts...html[component to template]
or in button click you are sending data...to ts
one way data binding:
component to view
interpolation
property binding
style binding
attribute binding
two way data binding
data flow view to component and vice versa
update and display same time
form:--
<input type=text [(ngModel)]="name">
{{name}}
Comments
Post a Comment