-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55783b9
commit a32eaf5
Showing
13 changed files
with
73 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, Type } from '@angular/core'; | ||
import { ROUTER_DIRECTIVES, Routes, Router } from '@angular/router'; | ||
|
||
import { HomeComponent } from './components/home/home.component' | ||
import { AboutComponent } from './components/about/about.component' | ||
|
||
@Component({ | ||
directives: [ROUTER_DIRECTIVES], | ||
providers: [Location], | ||
selector: 'my-app', | ||
styles: [`h1 { | ||
color: white; | ||
background: darkgray; | ||
padding: 20px; | ||
} | ||
.router-link-active { font-weight: bold }`], | ||
template: ` | ||
<h1>My First {{name}} app</h1> | ||
<router-outlet></router-outlet> | ||
<a [routerLink]="['/']">Home</a> | <a [routerLink]="['/about']">About</a>`, | ||
}) | ||
@Routes([ | ||
{ component: <Type>HomeComponent, path: "/" }, | ||
{ component: <Type>AboutComponent, path: "/about" } | ||
]) | ||
export class AppComponent { | ||
name: string = "Angular 2 on Express"; | ||
|
||
constructor(private router: Router) {} | ||
} |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<h2>Page: {{name}}</h2> | ||
|
||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras semper feugiat velit in aliquet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam dictum sodales dui vehicula convallis. Donec mattis pharetra lacus feugiat ultrices. Curabitur placerat interdum ligula, quis suscipit velit iaculis at. Etiam mollis ex et cursus elementum. Suspendisse nec elit ante. Praesent pharetra pharetra tellus, rutrum lobortis odio viverra vitae.</p> |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
@Component({ | ||
selector: 'my-about', | ||
templateUrl: 'components/about/about.component.html', | ||
styleUrls: ['components/about/about.component.css'] | ||
}) | ||
export class AboutComponent { | ||
name: string = "About Us"; | ||
|
||
constructor() {} | ||
} |
Empty file.
2 changes: 1 addition & 1 deletion
2
app/components/app.component.html → app/components/home/home.component.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { bootstrap } from '@angular/platform-browser-dynamic'; | ||
import { AppComponent } from './components/app.component' | ||
import { Type } from '@angular/core'; | ||
import { Type, provide } from '@angular/core'; | ||
import { HTTP_PROVIDERS } from "@angular/http"; | ||
import { ROUTER_PROVIDERS } from '@angular/router'; | ||
import { HashLocationStrategy, LocationStrategy } from "@angular/common"; | ||
|
||
import { AppComponent } from './app.component' | ||
|
||
bootstrap(<Type>AppComponent, [ | ||
HTTP_PROVIDERS | ||
HTTP_PROVIDERS, | ||
ROUTER_PROVIDERS, | ||
provide(LocationStrategy, {useClass: <Type>HashLocationStrategy}) | ||
]); |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
"noImplicitAny": false | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"typings/main", | ||
"typings/main.d.ts" | ||
"node_modules" | ||
] | ||
} |
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,7 +1,7 @@ | ||
{ | ||
"ambientDependencies": { | ||
"globalDependencies": { | ||
"core-js": "registry:dt/core-js#0.0.0+20160317120654", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446", | ||
"node": "registry:dt/node#4.0.0+20160509154515" | ||
} | ||
} |