All fields

“Dependency Injection Providers & Injection Tokens” in Information Technology

14 questions across 1 technology.

Information Technology

14 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is a provider in Angular's dependency injection system? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensBeginner
2What is an injection token in Angular, and when would you need one instead of just injecting a class? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensIntermediate
3What does providedIn root mean when registering an Angular service? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensBeginner
4What is the difference between providing a service using useClass and useExisting? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensIntermediate
5How does the useFactory provider option let you create a service with more complex setup logic? Angular › Dependency Injection Providers & Injection TokensAngularDependency Injection Providers & Injection TokensAdvanced
6What is dependency injection in Angular, and how does a component receive a service? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionBeginner
7What is hierarchical dependency injection in Angular, and how does providing a service at the component level differ from providing it at the root level? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionAdvanced
8What is a service in Angular and why are services used to hold shared logic? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionBeginner
9How would you mock a service during testing to isolate a component from its real dependencies? Angular › Services & Dependency InjectionAngularServices & Dependency InjectionIntermediate
10What is a helpful first step when debugging an error message shown in the browser console for an Angular app? Angular › Angular DevTools & DebuggingAngularAngular DevTools & DebuggingBeginner
11Why should you avoid storing sensitive information, like an authentication token, directly in an Angular app's local storage? Angular › Angular Security (XSS, Sanitization & CSP)AngularAngular Security (XSS, Sanitization & CSP)Beginner
12Why is the constructor generally not the right place to fetch data or perform complex setup in an Angular component? Angular › Lifecycle HooksAngularLifecycle HooksBeginner
13How do you bootstrap an Angular application using only standalone components, without a root NgModule? Angular › Standalone ComponentsAngularStandalone ComponentsBeginner
14How do you use Angular's TestBed to test a component that depends on a service? Angular › Testing with Jasmine & KarmaAngularTesting with Jasmine & KarmaIntermediate