Angular Interview Questions Flashcards

1
Q

default modules

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Lifecycle hooks

A

predefined methods in angular that enable developers to access stages of a components life cycle.

beginds with instantiation and rendering of the view and ends with destruction and removal of a component directive from the DOM.

Angular performs change detection throughout lifecycle to update the view and component instance when need.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ngOnChanges

A

when 1 > more input properties of a component change, this method is invoked.

receives object containing the input properties prior and present values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

NgOnInit

A

method invoked after component initialization and when the input properties have been set. The ideal place to perform initialization logic that depends on input properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ngAfterViewInit

A

method called once we verify component view has been initialized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ngAfterViewChecked

A

This method is called after the component’s view has been checked for changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

ngOnDestroy

A

This method is invoked before the component’s destruction. It enables you to perform any cleanup logic necessary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

ngDoCheck

A

We call this method during every change detection cycle of the component. It enables you to custom change detection logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

ngAfterContentInit

A

We invoke this method only after the component’s content has been projected into its view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly