Angular Flashcards
✅ Explain Hot and cold observables
N/A
✅ 8 building blocks
Module, Components, Templates, Directives, Data-binding, Decorators, Services, Routing
✅ What is ChangeDetection?
Default, onPush, ChangeDetectionRef
✅ Observable Callback methods (3)
next, error, complete
✅ Important things the router does? (4)
URL Structure Lazy loading Guards Redirects / Navigates
✅ Event binding vs Property Binding vs Interpolation
N/A
✅ What is ngZone?
runOutsideAngular run
✅ What is an interceptor?
next.handle()
✅ JIT vs AOT
N/A
✅ Types of directives (2)
Structural and Directives
✅ Component LifeCycle hook
ngOnChanges ngOnInit ngDoCheck ngAfterContentInit ngAfterContentChecked ngAfterViewInit ngAfterViewChecked ngOnDestroy
✅ Explain @ViewChild
to find first HTML element matching the selector
✅ Differences: Observables vs Promises (4)
Multiple values - Single value Lazy - Not Lazy Cancellable vs Not cancellable Observable has rxjs operators.
✅ Custom Two-way binding VS ngModel
ngModel for native elements. custom two-way binding: eg. Input - size Output - sizeChanged
✅ Types of subjects
Subject BehaviorSubject ReplaySubject AsyncSubject
✅ Constructor (1) vs (2) ngOnInit
Constructor - Inject services ngOnInit - Initialize values - service calls
✅ 6 ways to debug
1 - F12 > source > breakpoint on files 2 - debugger; statement 3 - tap on rxjs 4 - redux devtools for ngrx 5 - custom logger 6 - visual studio code extensions
✅ ViewEncapsulation
N/A
✅ ng-content
N/A
⚠️Reactive Forms vs TemplateDriven
⚠️
✅ How to prevent memory leaks? (2)
Use Async pipe and kill every subscription
✅ Angular Tree Shaking
N/A
✅ How to improve the performance of an Angular App? (8)
1- Cache
2 - memoization
3- Use onPush and detach Change detection
4- Lazy loading
5- Update your angular App and CLI
6 - AOT
7. Compress images
8 - Reduce amount of round-trips to the server (http calls)
✅ What is Memoization?
if the function is called with the same inputs,
we directly return the result in the cache
✅ What is Angular Universal?
Server-Side Rendering (SSR) with Angular
✅ How many rxjs operators?
More than 100