Expert level Angular Interview Questions Part -1
3 min readMar 26, 2021
Components
- How is changing the CD strategy to onPush impact component?
- How to make child component data two way data binding?
- What is the dynamic component?
- What is an angular element?
- What is a component factory resolver?
- In Parent to child component communication. Suppose an object have two properties only change in one property in parent, Will change reflect in the child component?
Like : — Employee = { name : ‘Anil’ , department:’Engineering’}
Templates
- Explain Styling precedence ?
- Difference between @Attribute() vs @Input()?
- How to use svg file as templates?
- Template type checking in custom directive?
- Describe 3 Mode of template type checking?
- Enlight the ngAfterContentChecked and ngAfterViewChecked?
- Write code for custom pipe for change the string to title case? How impure pipe impact angular.
- How pipe change detection works for primitive and references objects ?
- What is use of Async pipe ?
- Which have higher precedence between pipe and ternary operator ?
- What is innerHtml? If we bind a string like
Title = ‘Template <script>alert(“evil never sleeps”)</script> Syntax’;
<p><span>”{{Title}}” title.</span></p>
will it bind?
12. How to made custom two way binding like ngModel?
13 . What happens if assign template local reference variable on ng-template?
Directives
- What is template input variable?
- Which Module need to import for using built in directives?
- Is angular selector support parent child relationship ?
- Explain Hostbinding, Hostlistener?
- Explain ContentChildren and ViewChild ?
- Write the syntax for ngClass use cases?
- Tell the use case of ngModel Change ?
- Explain the use of trackby?
- How to host a directive without Dom?
- What is ElementRef use?
- How to stop/Deactivate the processing of directive or binding ?
- How to create template fragments ?
- What is template guard?
Dependency Injection
- What is a provider token?
- How to provide an alternative Class provider?
- What is a factory provider?
- What is a parameter decorator?
- Making dependency option and search with a host?
- How to alias class interface?
- How to inject an object? syntax also?
- What is the use of @Inject or How to supply a custom provider?
Routing & Navigation
- What is the difference between canLoad and canActivate?
- What is a router event ? name the any of ?
- Differentiate the param and query param in lazyloading?
- How to redirect any path ?
- What does pathMatch signifies ?
- What are auxiliary routes?
- What is canResolve route guard?
- What is the location strategy? Please enlighten the type also? Or There are two kind of Url one with hash one without hash compare both?
- Explain the properties of the activated route?
- How to use a scroll event in navigation?
- Name the navigation event trigger when loading lazyload routes?
Forms
- What form approaches are available ? Among them which is best and why?
- In Which form of approach data model is immutable?
- How does data flow differently in template and reactive forms?
- What is benefit of ngForm Driective ?
- Differentiate the pristine dirty touched ?
- How to put custom validation in template driven forms?
- What is use of remove Control ?
- How to use Update Model?
- How to show validation errors in dynamic template driven form and reactive forms ?
- Write code for custom validation for reactive forms ?
- What is cross field validation?
- Implement async validator for template driven form?
- How to compose dynamic form content?
PART 2 >>. — — — — — — — — — — — — — — — — — — — — — — — — PART 3 >>