Sunday 9 September 2018

Angular 2, 4,5 and 6 interview questions — Set 2

Angular 2, 4,5 and 6 interview questions — Set 2

Update: Answers added.
If you have not gone through Set 1 yet, please check out it first.


1. Angular web application can only be written using Typescript as code behind language
a. True
b. False
2. Fill in blank keyword used to implement inheritance in typescript ?
<derived class>____________<baseclass>
3. Decorator is a class?
a. True
b. False
4. Optional parameter is marked using below syntax:
a. Fun(name:string=”balram”)
b. Fun(name?:string)
c. Fun(…names:string[])
5. We can have constructor overloading in Typescript
a. True
b. False
6. In Angular, you can hide/remove HTML element using
a. #ngIf
b. *ngIf
c. #hide
d. *hide
7. There can be more than one RootModule in Angular
a. True
b. False
8. ngFor can be applied on any HTML tag e.g.<div> and not just <li>
a. True
b. False
9. We can implement two-way data binding using
a. [ngModel]
b. [(ngModel)]
c. (ngModel)
d. ng-Model
10. For standard HTML onclick event, we can have below Angular event
a. (onclick)
b. (click)
c. (clickhandler)
d. [click]
11. EventEmitter data type implementation uses generics concept of Typescript.
a. True
b. False
12. You can update background color of <div> HTML tag using [ngStyle]
a. True
b. False
13. You can have more than one #local variable for an HTML element. E.g. <input #ref1 #ref2>
a. True
b. False
14. Angular custom/built-in Directives cannot listen to standard HTML event raised on their host
a. True
b. False
15. Using Template Driven Form, you can create dynamic form layout
a. True
b. False
16. Choose correct form control class name which is set to true when blur event gets fired on control
a. .ng-valid
b. .ng-invalid
c. .ng-pending
d. .ng-pristine
e. .ng-dirty
f. .ng-untouched
g. .ng-touched
17. Angular Service can be injected at Root Module, Feature Module or Component level
a. True
False
18. You can modify DOM of target element using Pipe
a. True
b. False
19. You can define 404 route using below wild card route path
a. **
b. /
c. ##
d. default
20. Below service can be injected in your component to do dynamic route navigation
a. Router
b. Routing
c. RouterService
d. RoutingService

Answers:

1. b
2. extends
3. b
4. b
5. b
6. b
7. b
8. a
9. b
10. b
11. a
12. a
13. b
14. b
15. b
16. g
17. a
18. b
19. a
20. a

No comments:

Post a Comment

40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot

  40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot 1. What is Tight Coupling? When a class (ClassA) is depen...