JavaScript Online Training

Angular interview questions you should know in 2021


1. Why compilation process is needed while using angular application?

The browser can not understand the templates and the components of angular directly. There is a process of compilation is needed before running in a browser for angular application. So compilation process is an essential part of angular application. Taking an example we come to know that during building phase of an application the conversion of angular HTML and typescript into efficient Java script code is needed for running it in the browser.

2. How the control of AOT compilation happen?

: If we will provide options of template compiler in the files of tsconfig.json then AOT compilation can be controlled.

: For controlling AOT compilation the decorators should be configured with angular metadata

3. Write down the limits of metadata.

: Metadata should be written within the general constraints as given below

: The expression syntax should be written within the range of JavaScript online training that are supported.

: The exported symbols can be referred only

: The functions which are supported by the compiler should be called only

: There should be public members of data bound class

4. Write about different phases of AOT.

: The phase where the code is analyzed- the representation of the source is recorded by the compiler

: The phase where a code is generated- in this phase the interpretations are handled also there is a restriction on interpreting.

: Phase of validation- the typescript compiler is used by angular template compiler for validation of the expressions of binding present in templates.

5. Why metadata json files are used in angular application?

The metadata of a diagram of overall structure decorator can be a metadata json file which can be represented as an AST. The metadata which is recorded in the angular decorators is scanned by the AOT collector while analyzing the input.

6. What do you mean by macros in angular?

Generally when macros are in the form of functions it supports the compiler of AOT and in a single return expression they return the expressions. Macros can be used as an expression inside the metadata in JavaScript course.

7. What do you mean by folding?

In folding process during the collection and record of the metadata results are evaluated as an expression by the collector instead of evaluating the original expressions. The exported symbols in metadata can be solved by the compiler. Selector reference can not be referred by the compiler.

8. What are the errors that may come in metadata?

:The error occurs when there is no support from expression form- it is seen that sometimes the syntax used in angular metadata are the restricted expressions which are the outside language feature of the compiler, they are responsible for production of error.

: If reference is taken from a local symbol then there is a chance for producing error

9.How angular template compiler option can be specified?

The object in the tsconfig.json file which are the members of the angular compilation operation are specified as angular template compiler option. The option which is adjecent to the option of typescript compiler is known as angular template compiler option.

10. How dynamic script is injected in angular?

Dom sanitizer is used to inject dynamic script in angular.

These are the questions you can look at to prepare for angular interview.

Write a Comment