- Angular 2 - Home
- Angular 2 - Overview
- Angular 2 - Environment
- Angular 2 - Hello World
- Angular 2 - Modules
- Angular 2 - Architecture
- Angular 2 - Components
- Angular 2 - Templates
- Angular 2 - Directives
- Angular 2 - Metadata
- Angular 2 - Data Binding
- CRUD Operations Using HTTP
- Angular 2 - Error Handling
- Angular 2 - Routing
- Angular 2 - Navigation
- Angular 2 - Forms
- Angular 2 - CLI
- Angular 2 - Dependency Injection
- Angular 2 - Advanced Configuration
- Angular 2 - Third Party Controls
- Angular 2 - Data Display
- Angular 2 - Handling Events
- Angular 2 - Transforming Data
- Angular 2 - Custom Pipes
- Angular 2 - User Input
- Angular 2 - Lifecycle Hooks
- Angular 2 - Nested Containers
- Angular 2 - Services
Angular 2 Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Angular 2. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following is correct about TypeScript?
A - Angular 2 is based on TypeScript.
B - This is a superset of JavaScript.
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following is true?
A - Angular 2 Services can be used to add more data to an Angular JS class.
B - Angular 2 Metadata can be used to add more data to an Angular JS class.
C - Angular 2 Components can be used to add more data to an Angular JS class.
Answer : B
Explanation
Angular 2 Metadata can be used to add more data to an Angular JS class.
Q 3 - Which of the following is correct about Export Array in Angular 2 Modules?
B - This is used to export services which can then be used in other services.
Answer : A
Explanation
Angular 2 Export array is used to export components, directives, and pipes which can then be used in other modules.
Q 4 - Which of the following is correct about Angular 2 Routing?
B - Based on the option they choose, the required Angular Component will be rendered to the user.
Answer : C
Explanation
Angular 2 applications have the option of error handling. This is done by including the ReactJS catch library and then using the catch function. The catch function contains a link to the Error Handler function.
Q 5 - Which of the following is correct about package.json?
Answer : C
Explanation
There are two types of dependencies, first is the dependencies and then there are dev dependencies. The dev ones are required during the development process and the others are needed to run the application.
Q 6 - Which of the following filter is used to convert input to all lowercase?
Answer : A
Explanation
lowercase filter is used to convert the input to all lowercase.
Q 7 - Which of the following filter is used to convert an input string to date format.
Answer : B
Explanation
date filter is used to convert an input string to date format.
Q 8 - Which of the following is correct about lifecycle hook - ngAfterContentInit.
A - When the value of a data bound property changes, then this method is called.
C - This is for the detection and to act on changes that Angular can't or won't detect on its own.
D - This is called in response after Angular projects external content into the component's view.
Answer : D
Explanation
ngAfterContentInit method is called in response after Angular projects external content into the component's view.
Q 9 - Which of the following is correct about lifecycle hook - ngOnDestroy.
A - This is called in response after Angular checks the content projected into the component.
B - This is called in response after Angular initializes the component's views and child views.
C - This is called in response after Angular checks the component's views and child views.
D - This is the cleanup phase just before Angular destroys the directive/component.
Answer : D
Explanation
ngOnDestroy method is the cleanup phase just before Angular destroys the directive/component.