1 Setup
1 Setup
• Nodejs installation
• Create one folder and open in vs code
If any error
App.component.ts and html
one way data binding
If change the value in that variable
then error
Two way binding(change the value
in html also possible)
String interpolation
Attribute binding
String interpolation
We can given like this too
string message with variable
But in attribute binding it is not
possible
Property binding
Difference b/w property and
attribute
• Property binding and attribute binding are not same in angular
• Attributes means it is the attributes in html and once initialized,
attribute values do not change
• Property means part of the DOM and values can be modified
• Attributes are defined by HTML and properties are defined by DOM
itself
Now output okay…but when null
value passed??
Now error occured
Safe navigation operator used for
solving this problem
Property binding,safe navigation
operator and lifecycle hook
Event binding
Generate new component and do
this 2 steps
Counter component
Structural directives-ngFor
Access the index by using ‘index’
ngIf
Ngclass
Exercise using ngmodel and ngif
ngModel,ngIf and ngClass
Both are same
ngStyle
Custom directives
For using this directive….
First access in our .ts file and then only use it in
html file of it
If it is empty string then default
color yellow will be applied
Pipes – like inbuilt function
should add CommonModule
Date with time
Slice pipe
In array
uppercase
Currency pipe
Sharing data b/w components
Create list component
Passing data from form component
to app component
Push the value into array which is
received from form
List.ts
Same data passing now done by
service
Pass the value from form.ts to
service
Servive.ts
List.ts