fix: refactor providers to use makeEnvironmentProviders
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
import { Provider } from '@angular/core';
|
||||
import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';
|
||||
|
||||
import { {{constantName}}_REPOSITORY } from '@/domain/repositories/{{classFilename}}.repository.contract';
|
||||
import { {{classname}}RepositoryImpl } from '@/data/repositories/{{classFilename}}.repository.impl';
|
||||
@@ -9,11 +9,17 @@ import { {{classname}}RepositoryImpl } from '@/data/repositories/{{classFilename
|
||||
/**
|
||||
* {{classname}} Repository Provider
|
||||
* Binds the repository contract with its implementation
|
||||
*
|
||||
* @returns EnvironmentProviders
|
||||
*/
|
||||
export const {{classname}}RepositoryProvider: Provider = {
|
||||
provide: {{constantName}}_REPOSITORY,
|
||||
useClass: {{classname}}RepositoryImpl
|
||||
};
|
||||
export function provide{{classname}}Repository(): EnvironmentProviders {
|
||||
return makeEnvironmentProviders([
|
||||
{
|
||||
provide: {{constantName}}_REPOSITORY,
|
||||
useClass: {{classname}}RepositoryImpl
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
{{/operations}}
|
||||
{{/apis}}
|
||||
|
||||
Reference in New Issue
Block a user