diff --git a/angular-cli.json b/angular-cli.json index b848f7c..186a019 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -18,7 +18,8 @@ "tsconfig": "tsconfig.json", "prefix": "app", "styles": [ - "styles.css" + "styles.css", + "../node_modules/bootstrap/dist/css/bootstrap.min.css" ], "scripts": [], "environments": { diff --git a/package.json b/package.json index 4d809d7..6af0c8e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", + "bootstrap": "^3.3.7", "core-js": "^2.4.1", "rxjs": "^5.0.1", "ts-helpers": "^1.1.1", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2e78886..bd46cbb 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,5 +15,3 @@ alert('sss'); } - -} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 67a1a23..a3e13f5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,20 +2,33 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; +import { RouterModule, Routes } from '@angular/router'; import { AppComponent } from './app.component'; import { innerComponent } from './inner/inner.component'; +import { RoutingComponent } from './routing.component'; + +const routers: Routes = [ + {path : '', redirectTo : '/Inner', pathMatch:'full'}, + { path: 'Inner', component: innerComponent }, + { path: 'Outer', component: AppComponent }, + { path: '**', redirectTo: '/Inner', pathMatch: 'full' } +] @NgModule({ declarations: [ - AppComponent, innerComponent + AppComponent, + innerComponent, + RoutingComponent ], imports: [ BrowserModule, FormsModule, - HttpModule + HttpModule, + RouterModule.forRoot(routers) ], providers: [], - bootstrap: [AppComponent] + //bootstrap: [AppComponent] + bootstrap: [RoutingComponent] }) export class AppModule { } diff --git a/src/app/inner/inner.component.html b/src/app/inner/inner.component.html index da28161..ee59dd1 100644 --- a/src/app/inner/inner.component.html +++ b/src/app/inner/inner.component.html @@ -15,13 +15,13 @@