-
Notifications
You must be signed in to change notification settings - Fork 22
/
ngx-your-library.ts
37 lines (34 loc) · 1.01 KB
/
ngx-your-library.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { NgModule, ModuleWithProviders } from "@angular/core";
import { SampleComponent } from './src/app/components/sample.component';
import { SampleDirective } from './src/app/directives/sample.directive';
import { SamplePipe } from './src/app/pipes/sample.pipe';
import { SampleService } from './src/app/services/sample.service';
// for manual imports
export * from './src/app/components/sample.component';
export * from './src/app/directives/sample.directive';
export * from './src/app/pipes/sample.pipe';
export * from './src/app/services/sample.service';
@NgModule({
declarations: [
SampleComponent,
SampleDirective,
SamplePipe
],
providers: [
SampleService
],
exports: [
SampleComponent,
SampleDirective,
SamplePipe
]
})
export class YourLibModule {
/* optional: in case you need users to override your providers */
static forRoot(configuredProviders: Array<any>): ModuleWithProviders {
return {
ngModule: YourLibModule,
providers: configuredProviders
};
}
}