-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(modules): split every directive into separate module
And remove required static module methods. This together allows greater tree-shaking abilities. All changes to public API are done in deprecation manner - meaning nothing should be done to update. However it is recommended to get rid of deprecated APIs to prepare for next major version.
- Loading branch information
Showing
33 changed files
with
286 additions
and
143 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
14 changes: 12 additions & 2 deletions
14
...ib/component-outlet-injector.directive.ts → ...or/component-outlet-injector.directive.ts
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
11 changes: 11 additions & 0 deletions
11
projects/ng-dynamic-component/src/lib/component-injector/component-outlet-injector.module.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { ComponentOutletInjectorDirective } from './component-outlet-injector.directive'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
exports: [ComponentOutletInjectorDirective], | ||
declarations: [ComponentOutletInjectorDirective], | ||
}) | ||
export class ComponentOutletInjectorModule {} |
3 changes: 3 additions & 0 deletions
3
projects/ng-dynamic-component/src/lib/component-injector/index.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './token'; | ||
export * from './component-outlet-injector.directive'; | ||
export * from './component-outlet-injector.module'; |
20 changes: 20 additions & 0 deletions
20
projects/ng-dynamic-component/src/lib/component-injector/token.ts
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ComponentRef, InjectionToken } from '@angular/core'; | ||
|
||
export interface DynamicComponentInjector { | ||
componentRef: ComponentRef<any> | null; | ||
} | ||
|
||
/** | ||
* @deprecated Since v6.0.0 - Use {@link DynamicComponentInjector} instead | ||
*/ | ||
export type ComponentInjector = DynamicComponentInjector; | ||
|
||
export const DynamicComponentInjectorToken = new InjectionToken< | ||
DynamicComponentInjector | ||
>('DynamicComponentInjector'); | ||
|
||
/** | ||
* @deprecated Since v6.0.0 - Use {@link DynamicComponentInjectorToken} instead | ||
* and provide component class via `useExisting` instead of `useValue` | ||
*/ | ||
export const COMPONENT_INJECTOR = DynamicComponentInjectorToken; |
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
11 changes: 11 additions & 0 deletions
11
projects/ng-dynamic-component/src/lib/dynamic-attributes/dynamic-attributes.module.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { DynamicAttributesDirective } from './dynamic-attributes.directive'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
exports: [DynamicAttributesDirective], | ||
declarations: [DynamicAttributesDirective], | ||
}) | ||
export class DynamicAttributesModule {} |
2 changes: 2 additions & 0 deletions
2
projects/ng-dynamic-component/src/lib/dynamic-attributes/index.ts
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dynamic-attributes.directive'; | ||
export * from './dynamic-attributes.module'; |
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
11 changes: 11 additions & 0 deletions
11
projects/ng-dynamic-component/src/lib/dynamic-directives/dynamic-directives.module.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { DynamicDirectivesDirective } from './dynamic-directives.directive'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
exports: [DynamicDirectivesDirective], | ||
declarations: [DynamicDirectivesDirective], | ||
}) | ||
export class DynamicDirectivesModule {} |
2 changes: 2 additions & 0 deletions
2
projects/ng-dynamic-component/src/lib/dynamic-directives/index.ts
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dynamic-directives.directive'; | ||
export * from './dynamic-directives.module'; |
Oops, something went wrong.