Angular MCQ for freshers
Categories: MCQS
Angular MCQ for freshers
1. What is Angular?
a. A framework for building web applications.
b. A programming language.
c. A library for building web applications.
Answer: a
2. What is the latest version of Angular?
a. AngularJS
b. Angular 1.x
c. Angular 2+
d. Angular 10
Answer: d
3. What is the purpose of NgModule in Angular?
a. To define a module.
b. To define a component.
c. To define a service.
Answer: a
4. What is the purpose of ngFor directive in Angular?
a. To create a new component.
b. To loop through a collection and render each element.
c. To display data in a tabular format.
Answer: b
5. What is a component in Angular?
a. A module that encapsulates related functionality.
b. A reusable piece of code that represents a part of the UI.
c. A function that is used to manipulate the DOM.
Answer: b
6. What is a service in Angular?
a. A module that encapsulates related functionality.
b. A reusable piece of code that represents a part of the UI.
c. A class that provides functionality to components.
Answer: c
7. What is the difference between constructor and ngOnInit in Angular?
a. The constructor is used to create an instance of a class, while ngOnInit is called after the constructor to initialize the component.
b. The constructor is used to initialize the component, while ngOnInit is called to create an instance of a class.
c. There is no difference between constructor and ngOnInit.
Answer: a
8. What is data binding in Angular?
a. A technique used to connect data from a component to a view.
b. A technique used to connect data from a view to a component.
c. A technique used to connect data between components.
Answer: a
9. What is a directive in Angular?
a. A reusable piece of code that represents a part of the UI.
b. A function that is used to manipulate the DOM.
c. A marker on a DOM element that tells Angular to do something with that element.
Answer: c
10. What is a module in Angular?
a. A reusable piece of code that represents a part of the UI.
b. A file that contains related functionality, such as components and services.
c. A class that provides functionality to components.
Answer: b