Angular interview Questions part 3

 1. What is camel case and pascal case?

Pascal case has uppercase for  the first letter of every word in the identifier. 

Example of Pascal case :  ThisIsIdentifier 

With camel case this is not the scenario. Here first letter of first word is small and every subsequent word begin with the uppercase. 

Example of Camel Case : thisIsIdentifier


2. What are directives?

Directives are  the functions in angular that have the capability of changing the behavior of the html.

Examples : ngModel, ngIf, ngFor, etc.


3. What is the use of ngModel and significance of [] and () in ngModel?

ngModel is a directive that is used to bind the data to and from the model with view through component. Using the ngModel directive we can bind the input, select and textarea and store the value in a variable for future use.

Example (ngModel) : if we use it like this it will bind data to the model.

                [ngModel] : if we use it like this it will bind data to the view .

                [(ngModel)] :  if we use it like this, it is said to be bidirectional data binding.


4. What are expressions or interpolation?

Expression or interpolation are the types of unidirectional data binding that are generally used to display the data to the view. 

Example: If I wish to display the data of a variable 'thisIsData' then using interpolation binding I can do it as;

            {{ thisIsData }}


5. What is the importance of FormsModule?

   FormsModule is a module that is needed while working with the template-driven form to capture the user input. It brings so many directives and providers with it. It includes directives like EmailValidator, MinLengthValidator, MaxLengthValidator, etc.


Video Tutorial: