1. What is camel case and pascal case?
- With camelCase, the first letter of the first word in the identifier is lower case, while the first letter of every subsequent word is uppercase. for eg: newMaheshIdentifier.
- And with PascalCase, the first letter of every word in the identifier is upper case. For eg: NewMaheshIdentifier.
Directives are custom HTML attributes which tell angular to change the style or behavior of the DOM elements.
3. What is the use of ngModel and significance of [ ] and ( ) in ngModel?
ngModel is a directive which binds input, stores the required user value in a variable, and select the textarea and we can use that variable whenever we require that value; It also used during validation in a form. We can use ngModel with:
1. Input
- text
- chechbox
- radio
- number
- url
- date
- datetime-local
- time
2. select
3. textarea
- [ngModel] - it's property binding only, not two-way binding. So entering new value will not update overRideRate. And [ngModel] is just show up.
- [(ngModel)] is two-way binding that comes from Angular.
Interpolation refers to embedding expressions into marked up text. By default, interpolation uses as its delimiter the double curly braces, like: {{mahesh}} .
For eg:
<h1>Current customer: {{ maheshApplication }}</h1>
5. What is the importance of FormsModule?
FormsModule exports the required providers and directives for template-driven forms, making them available for import by NgModules that import this module. It contains the directives as: CheckboxControlValueAccessor, NumberValueAccessor, PatternValidator etc
0 comments:
Post a Comment