diff --git a/src/star-rating.module.ts b/src/star-rating.module.ts index 4188031..6209c3e 100644 --- a/src/star-rating.module.ts +++ b/src/star-rating.module.ts @@ -1,19 +1,23 @@ -import { NgModule } from '@angular/core'; +import { ModuleWithProviders, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { StarRatingComponent } from "./star-rating.component"; -import { StarRatingConfig } from "./star-rating-config" +import { StarRatingComponent } from './star-rating.component'; +import { StarRatingConfig } from './star-rating-config'; -export{ StarRatingComponent} from "./star-rating.component"; -export { StarRatingConfig } from "./star-rating-config" +export{ StarRatingComponent } from './star-rating.component'; +export { StarRatingConfig } from './star-rating-config' -const EXPORTS = [ StarRatingComponent ]; +const EXPORTS = [StarRatingComponent]; @NgModule({ - imports: [ CommonModule ], - exports: [ EXPORTS ], - declarations: [ EXPORTS ], - providers: [ StarRatingConfig ] + imports: [CommonModule], + exports: [EXPORTS], + declarations: [EXPORTS] }) export class StarRatingModule { - + static forRoot(): ModuleWithProviders { + return { + ngModule: StarRatingModule, + providers: [StarRatingConfig] + } + } }