This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(preset): Make sure AOT will be able to collect metadata
And also accept preseted component so further operations can be possible (like custom decorators) BREAKING CHANGE: Now module import module instead of `.withPreset` -> `.forComponent` by passing component to apply preset on as the first argument and preset component itself as second argument
- Loading branch information
Alex Malkevich
committed
Jan 2, 2018
1 parent
2580ef5
commit db7c939
Showing
6 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { ModuleWithProviders, NgModule, Type } from '@angular/core'; | ||
|
||
import { createWithPresetMethodFor, PresetModule } from '../../preset'; | ||
import { PresetModule } from '../../preset'; | ||
import { providePresetFor } from '../../preset/preset-method'; | ||
import { MyComponentModule } from './my-component.module'; | ||
import { MyPreset } from './my-preset'; | ||
import { MyComponent } from './my.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
PresetModule, | ||
MyComponentModule, | ||
PresetModule.forComponent(MyComponent), | ||
], | ||
exports: [MyComponentModule], | ||
}) | ||
export class MyCustomModule { | ||
static withPreset = createWithPresetMethodFor<MyPreset>(MyCustomModule); | ||
static withPreset(presetType: Type<MyPreset>): ModuleWithProviders { | ||
return providePresetFor(MyCustomModule, presetType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters