Skip to content

Commit

Permalink
feat(boot): use modules
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Aug 27, 2016
1 parent 561b681 commit 4bd12d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/client/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import {provideRouter, RouterConfig} from '@angular/router';
import {Routes} from '@angular/router';

import {BuildComponent} from './build/build.component';
import {ChampionsComponent} from './champions/champions.component';
import {FeaturesComponent} from './features/features.component';
import {RegionsComponent} from './region/region.component';

export const routes: RouterConfig = [
export const ROUTES: Routes = [
{path: ':region/:champion/summoner/:summoner', component: BuildComponent},
{path: ':region/:champion/build', component: BuildComponent},
{path: ':region/:champion', component: FeaturesComponent},
{path: ':region', component: ChampionsComponent}, {path: '', component: RegionsComponent}
];

export const APP_ROUTER_PROVIDERS = [provideRouter(routes)];
16 changes: 6 additions & 10 deletions src/client/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
*/

import {enableProdMode, NgModule} from '@angular/core';
import {HTTP_BINDINGS} from '@angular/http';
import {HttpModule} from '@angular/http';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {ROUTER_DIRECTIVES} from '@angular/router';
import {RouterModule} from '@angular/router';

import {AppComponent} from './app.component';
import {APP_ROUTER_PROVIDERS} from './app.routes';

import {ROUTES} from './app.routes';
import {BuildComponent} from './build/build.component';
import {ChampionsComponent} from './champions/champions.component';
import {FeaturesComponent} from './features/features.component';
Expand All @@ -37,12 +36,9 @@ if (ENV === 'production') {
}

@NgModule({
declarations: [
ROUTER_DIRECTIVES, AppComponent, BuildComponent, ChampionsComponent, FeaturesComponent,
RegionsComponent
],
imports: [BrowserModule],
providers: [APP_ROUTER_PROVIDERS, HTTP_BINDINGS],
declarations:
[AppComponent, BuildComponent, ChampionsComponent, FeaturesComponent, RegionsComponent],
imports: [BrowserModule, RouterModule.forRoot(ROUTES), HttpModule],
bootstrap: [AppComponent]
})
class AppModule {
Expand Down

0 comments on commit 4bd12d2

Please sign in to comment.