Skip to content

Commit

Permalink
Slight tidy of example html, needs designing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMurphy committed Feb 11, 2016
1 parent 7857031 commit f362971
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
32 changes: 28 additions & 4 deletions examples/app.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
import {Component} from 'angular2/core';
import {HelloWorld} from '../src/hello-world/hello-world';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router';

import {HelloWorldExamples} from './hello-world';

@Component({
selector: 'app',
template: `
<h1>Examples</h1>
<hello-world><hello-world>
<div class="flexbox-container">
<div class="flexbox-container__column">
<ul>
<li><a [routerLink]="['HelloWorld']">Hello World</a></li>
<li><a href="./coverage">Test Coverage Report</a></li>
</ul>
</div>
<div class="flexbox-container__column">
<router-outlet></router-outlet>
</div>
</div>
`,
directives: [HelloWorld]
styles: [`
.flexbox-container {
display: flex;
}`,
`
.flexbox-container__column {
padding: 10px;
}
`],
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{ path: '/helloworld', name: 'HelloWorld', component: HelloWorldExamples }
])

export class App {
}
9 changes: 7 additions & 2 deletions examples/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import {bootstrap} from 'angular2/platform/browser';
import {App} from './app';
import {provide} from 'angular2/core';
import {ROUTER_PROVIDERS, LocationStrategy, HashLocationStrategy} from 'angular2/router';
import {App} from './app';

bootstrap(App);
bootstrap(App, [
ROUTER_PROVIDERS,
provide(LocationStrategy, { useClass: HashLocationStrategy })
]);
13 changes: 13 additions & 0 deletions examples/hello-world.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Component} from 'angular2/core';
import {HelloWorld} from '../src/hello-world/hello-world';

@Component({
selector: 'hello-world-examples',
template: `
<h1>Hello World</h1>
<hello-world><hello-world>
`,
directives: [HelloWorld]
})
export class HelloWorldExamples {
}
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>

<head>
<base href="/">
<title>Angular 2 Todos</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- IE required polyfills, in this exact order -->
Expand All @@ -13,6 +14,7 @@
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.3/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.3/angular2.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.3/router.dev.js"></script>
<script>
System.config({
transpiler: 'typescript',
Expand All @@ -28,7 +30,6 @@
</head>

<body>
<div><a href="./coverage">Coverage Report</a></div>
<app>Loading...</app>
</body>

Expand Down

0 comments on commit f362971

Please sign in to comment.