Initial router work.

This commit is contained in:
Matthew Ross 2016-07-13 05:59:19 -04:00
parent 07e38517e4
commit b9c83f19bc
8 changed files with 29 additions and 22 deletions

View File

@ -1,10 +1,2 @@
<!--<tb-login></tb-login>--> <router-outlet></router-outlet>
<tb-top-nav></tb-top-nav>
<tb-board></tb-board>
<!--<tb-dashboard></tb-dashboard>-->
<!--<tb-settings></tb-settings>-->

View File

@ -1,14 +1,9 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import { Login } from './login/login.component';
import { TopNav } from './top-nav/top-nav.component';
import { Board } from './board/board.component';
import { Settings } from './settings/settings.component';
import { Dashboard } from './dashboard/dashboard.component';
@Component({ @Component({
selector: 'app-component', selector: 'app-component',
directives: [ Login, TopNav, Board, Settings, Dashboard ], directives: [ ROUTER_DIRECTIVES ],
templateUrl: 'app/app.component.html' templateUrl: 'app/app.component.html'
}) })
export class AppComponent { export class AppComponent {

16
src/app/app.routes.ts Normal file
View File

@ -0,0 +1,16 @@
import { RouterConfig, provideRouter } from '@angular/router';
import { Login } from './login/login.component';
import { Board } from './board/board.component';
const ROUTES: RouterConfig = [
{
path: '',
component: Login
}
];
export const APP_ROUTER_PROVIDERS = [
provideRouter(ROUTES)
];

View File

@ -1,3 +1,5 @@
<tb-top-nav></tb-top-nav>
<div class="board-nav"> <div class="board-nav">
<label> <label>
Select Board: Select Board:

View File

@ -1,10 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { TopNav } from '../top-nav/top-nav.component';
@Component({ @Component({
selector: 'tb-board', selector: 'tb-board',
templateUrl: 'app/board/board.component.html' templateUrl: 'app/board/board.component.html',
directives: [ TopNav ]
}) })
export class Board { export class Board {
} }

View File

@ -1,6 +1,6 @@
<div class="login"> <div class="login">
<h1>TaskBoard</h1> <h1>TaskBoard</h1>
<input type="text" placeholder="Username" title="Username"> <input type="text" placeholder="Username" title="Username" autofocus>
<input type="password" placeholder="Password" title="Password"> <input type="password" placeholder="Password" title="Password">
<label><input type="checkbox"> Remember Me</label> <label><input type="checkbox"> Remember Me</label>
<button>Sign In</button> <button>Sign In</button>

View File

@ -1,16 +1,16 @@
import { bootstrap } from '@angular/platform-browser-dynamic'; import { bootstrap } from '@angular/platform-browser-dynamic';
// import { ROUTER_PROVIDERS } from '@angular/router';
import { HTTP_PROVIDERS } from '@angular/http'; import { HTTP_PROVIDERS } from '@angular/http';
//import { enableProdMode } from '@angular/core'; //import { enableProdMode } from '@angular/core';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { APP_ROUTER_PROVIDERS } from './app.routes';
import { Constants } from './app.constants'; import { Constants } from './app.constants';
//enableProdMode(); //enableProdMode();
bootstrap(AppComponent, [ bootstrap(AppComponent, [
// ROUTER_PROVIDERS,
HTTP_PROVIDERS, HTTP_PROVIDERS,
APP_ROUTER_PROVIDERS,
Constants Constants
]); ]);

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<title>TaskBoard</title> <title>TaskBoard</title>
<base href="/dist/"> <base href="/web/TaskBoard/dist/">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">