Skip to content

Commit 70aef43

Browse files
committed
feat(client): add account routing
1 parent 265681f commit 70aef43

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

templates/app/client/app/account(auth)/account.module.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,29 @@ import { FormsModule } from '@angular/forms';
33
import { BrowserModule } from '@angular/platform-browser';
44
<%_ if (filters.uirouter) { -%>
55
import { UIRouterModule } from 'ui-router-ng2';<% } %>
6-
<%_ if (filters.ngroute) { -%><% } %>
6+
<%_ if (filters.ngroute) { -%>
7+
import { RouterModule, Routes } from '@angular/router';<% } %>
78
<%_ if(filters.oauth) { -%>
89
import { DirectivesModule } from '../../components/directives.module';<% } %>
910

1011
import { STATES } from './account.routes';
1112

1213
import { LoginComponent } from './login/login.component';
13-
import { SignupComponent } from './signup/signup.component';
1414
import { SettingsComponent } from './settings/settings.component';
15+
import { SignupComponent } from './signup/signup.component';
16+
17+
<%_ if (filters.ngroute) { -%>
18+
const accountRoutes: Routes = [{
19+
path: 'login',
20+
component: LoginComponent,
21+
//data: { title: 'Home' }
22+
}, {
23+
path: 'settings',
24+
component: SettingsComponent,
25+
}, {
26+
path: 'signup',
27+
component: SignupComponent,
28+
}];<% } %>
1529

1630
@NgModule({
1731
imports: [
@@ -21,7 +35,8 @@ import { SettingsComponent } from './settings/settings.component';
2135
UIRouterModule.forChild({
2236
states: STATES,
2337
}),<% } %>
24-
<%_ if (filters.ngroute) { -%><% } %>
38+
<%_ if (filters.ngroute) { -%>
39+
RouterModule.forChild(accountRoutes),<% } %>
2540
<%_ if(filters.oauth) { -%>
2641
DirectivesModule,<% } %>
2742
],

templates/app/client/app/app.module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { AppComponent } from './app.component';
7474
import { MainModule } from './main/main.module';
7575
import { MainComponent } from './main/main.component';
7676
import { DirectivesModule } from '../components/directives.module';
77-
//import { AccountModule } from './account/account.module';
77+
import { AccountModule } from './account/account.module';
7878
//import { AdminModule } from './admin/admin.module';
7979

8080
import constants from './app.constants';
@@ -124,7 +124,7 @@ const appRoutes: Routes = [
124124
RouterModule.forRoot(appRoutes, { enableTracing: true }),<% } %>
125125
MainModule,
126126
DirectivesModule,
127-
//AccountModule,
127+
AccountModule,
128128
//AdminModule,
129129
],
130130
declarations: [

0 commit comments

Comments
 (0)