Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
typings
npm-debug.log
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html lang="en">

<head>
<base href= "/">
<title> Countries & Clubs </title>
<meta charset="UTF-8">
<title>Angular 2 - Countries and Capitals</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -15,6 +17,7 @@
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>

<!-- 2. Configure SystemJS -->
<script>
Expand Down
24 changes: 22 additions & 2 deletions src/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';

import {RouteConfig,ROUTER_DIRECTIVES,ROUTER_PROVIDERS} from 'angular2/router'
import { Dashboard } from './dashboard';
import {Header} from './header';
import {Footer} from './footer';
import {Countries} from './countries';

@Component({
selector: 'app',
directives: [ROUTER_DIRECTIVES,Header,Footer],
providers: [ROUTER_PROVIDERS],
template: `
<h1>Countries and Capitals</h1>
<header></header>
<router-outlet></router-outlet>
<footer></footer>
`,
})
@RouteConfig([
{
path: '/dashboard',
name: 'Dashboard',
component: Dashboard,
useAsDefault: true
},{
path: '/countries',
name: 'Countries',
component: Countries
}
])
export class App {}

bootstrap(App)
Expand Down
10 changes: 10 additions & 0 deletions src/countries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from 'angular2/core';
@Component({
selector: 'countries-list',
template: `
<hr><h3> Country List </h3>
`
})
export class Countries {
componentName: "Countries"
}
13 changes: 13 additions & 0 deletions src/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component } from 'angular2/core';
@Component({
selector: 'my-dashboard',
template: `
<hr>
<p>&nbsp;</p>
<div class="container"><p align='center'>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p></div>
`,
styleUrls: ['src/styles.css']
})
export class Dashboard {
componentName: "Dashboard"
}
15 changes: 15 additions & 0 deletions src/footer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from 'angular2/core';
import {RouterLink} from 'angular2/router'
@Component({
selector: 'footer',
directives: [RouterLink],
template:
`<p style="text-align: center">
<button [routerLink]="['/Dashboard']"> Dashboard </button>
<button [routerLink]="['/Countries']">Browse Countires </button>
</p>
`,
})
export class Footer {
componentName: "Footer"
}
10 changes: 10 additions & 0 deletions src/header.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from 'angular2/core';
@Component({
selector: 'header',
template: `
<h1 style="margin-left:40%;">Countries and Capitals</h1>
`
})
export class Header {
componentName: "Header"
}
4 changes: 4 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.container{
width:600px;
margin-left:35%;
}