K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which Angular lifecycle hook is called after content projection? (A) ngOnInit (B) ngAfterViewInit (C) ngAfterContentInit (D) ngDoCheck 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) ngAfterContentInit Explanation: ngAfterContentInit is called after projected content is initialized.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. What does the async pipe do? (A) Subscribes and unsubscribes automatically (B) Converts promises to observables (C) Handles HTTP calls (D) Improves routing speed 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) Subscribes and unsubscribes automatically Explanation: Async pipe handles subscription and unsubscription automatically.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which RxJS operator is used to cancel previous HTTP calls? (A) mergeMap (B) concatMap (C) switchMap (D) map 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) switchMap Explanation: switchMap cancels the previous observable when a new one is emitted.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which decorator is used to make a class injectable? (A) @Component (B) @NgModule (C) @Injectable (D) @Pipe 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) @Injectable Explanation: @Injectable marks a class available for dependency injection.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. What does ViewEncapsulation.ShadowDom do? (A) Disables CSS (B) Applies global styles (C) Uses native Shadow DOM for style encapsulation (D) Inlines styles 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) Uses native Shadow DOM for style encapsulation Explanation: ShadowDom uses browser's native Shadow DOM for encapsulation.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which guard prevents loading of lazy-loaded modules? (A) CanActivate (B) CanDeactivate (C) CanLoad (D) Resolve 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) CanLoad Explanation: CanLoad prevents lazy modules from being loaded.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which strategy allows preloading lazy-loaded modules? (A) NoPreloading (B) PreloadAllModules (C) EagerLoading (D) LoadOnDemand 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) PreloadAllModules Explanation: PreloadAllModules loads lazy modules in the background.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. What is a pure pipe? (A) Always recalculates (B) Executes only when input changes (C) Used only for numbers (D) Executes every change detection 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) Executes only when input changes Explanation: Pure pipes run only when their input values change.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. Which Angular feature helps in reducing bundle size? (A) NgModules (B) Lazy loading (C) Two-way binding (D) Event binding 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) Lazy loading Explanation: Lazy loading loads modules only when required.
K Kartik Sharma 🎓 Tutor III ⭐ 8.30K Points 📊 Angular Q. What does providedIn: 'root' do? (A) Creates multiple service instances (B) Provides service at component level (C) Registers service as singleton at root level (D) Disables DI 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) Registers service as singleton at root level Explanation: providedIn: 'root' creates a singleton service.