Angular 5 Interview Questions
Angular 5 Interview Questions
Angular 5 Interview Questions
Q4. Explain how component routing works in Angular. How to define routes and sub-
routes in Angular 5?
NPM stands for node package manager. It is used for installing dependencies for javascript packages.
Q6. What is Angular CLI? List the command to install Angular CLI?
Angular CLI is Command Line Interface for Angular that runs Webpack.You can use npm install -g
@angular/cli command to install angular CLI.
After installing Angular CLI run ng new project-name command to create a new Angular project.
Q8. What are Decorators?
Decorators are functions that adds metadata to class members and functions. It was proposed in ES2016 and
implemented in Typescript.
String Interpolation
Property Binding
Event Binding
Two-way-binding
ng serve command is used to run Angular5 application locally during development. To start development server
on specific port ng serve -p aPortNumber command is used.
Q11. What an Angular 5 component made of ? How do you generate a new component?
In Angular5 $event is a reserved keyword that represents the data emitted by an event (event data).It is
commonly used as a parameter for event based methods.
double curly brackets like {{}} are used form data interpolation in Angular5.
*ngFor directive is used for Iterating over a list of items and for Generating a new DOM element for each one.
Webpack is module bundler Bundler for Angular2 or above. It bundles, minifies and transpiles an Angular
application.
Transpiling is a process of converting code from one language to another. In Angular, Traceur compiler is used
for converting TypeScript to JavaScript so that browsers can understand.
In Angular component life cycle in Angular goes through the following stages.
Create
Render
Create and render children
Check for bound data changes and re-render
Destroy
NgModule is a decorator function in Angular that takes a single metadata object whose properties describe the
module.