-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(example): enable treeshakable providers (#1257)
- Loading branch information
1 parent
2a27e91
commit 1aa4b63
Showing
10 changed files
with
22 additions
and
42 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
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,40 +1,27 @@ | ||
import { NgModule, ModuleWithProviders } from '@angular/core'; | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { StoreModule } from '@ngrx/store'; | ||
import { EffectsModule } from '@ngrx/effects'; | ||
import { LoginPageComponent } from './containers/login-page.component'; | ||
import { LoginFormComponent } from './components/login-form.component'; | ||
|
||
import { AuthService } from './services/auth.service'; | ||
import { AuthGuard } from './services/auth-guard.service'; | ||
import { AuthEffects } from './effects/auth.effects'; | ||
import { reducers } from './reducers'; | ||
import { MaterialModule } from '../material'; | ||
import { AuthRoutingModule } from './auth-routing.module'; | ||
|
||
export const COMPONENTS = [LoginPageComponent, LoginFormComponent]; | ||
|
||
@NgModule({ | ||
imports: [CommonModule, ReactiveFormsModule, MaterialModule], | ||
declarations: COMPONENTS, | ||
exports: COMPONENTS, | ||
}) | ||
export class AuthModule { | ||
static forRoot(): ModuleWithProviders { | ||
return { | ||
ngModule: RootAuthModule, | ||
providers: [AuthService, AuthGuard], | ||
}; | ||
} | ||
} | ||
|
||
@NgModule({ | ||
imports: [ | ||
AuthModule, | ||
CommonModule, | ||
ReactiveFormsModule, | ||
MaterialModule, | ||
AuthRoutingModule, | ||
StoreModule.forFeature('auth', reducers), | ||
EffectsModule.forFeature([AuthEffects]), | ||
], | ||
declarations: COMPONENTS, | ||
}) | ||
export class RootAuthModule {} | ||
export class AuthModule {} |
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
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