Complete the code to provide multiple values for the same token using multi-provider.
providers: [{ provide: TOKEN, useValue: 'Value1', [1]: true }]The multi property set to true tells Angular this provider is part of a multi-provider array.
Complete the code to inject all providers registered under the multi-provider token.
constructor(@Inject(TOKEN) private [1]: string[]) {}The injected parameter should be an array to receive all values from the multi-provider token. Naming it values is clear and common.
Fix the error in the multi-provider registration by completing the missing property.
providers: [
{ provide: TOKEN, useValue: 'Value1', [1]: true },
{ provide: TOKEN, useValue: 'Value2', [1]: true }
]Both providers must have multi: true to be part of the multi-provider array. Missing it causes Angular to override the first provider.
Fill both blanks to create a multi-provider that uses a factory function and marks it as multi.
providers: [{ provide: TOKEN, useFactory: [1], [2]: true }]The useFactory property needs a function, here a simple arrow function returning a string. The multi property must be true to mark it as a multi-provider.
Fill all three blanks to create a multi-provider with a factory, dependencies, and multi flag.
providers: [{ provide: TOKEN, useFactory: [1], deps: [[2]], [3]: true }]The factory is a function returning a string. The deps array lists dependencies like HttpClient. The multi property set to true marks it as a multi-provider.