forked from PatrickJS/PatrickJS-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.ts
41 lines (36 loc) · 903 Bytes
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Angular 2 decorators and services
*/
import {Component} from 'ng-forward/cjs';
/*
* App Component
* Top Level Component
*/
@Component({
// The selector is what angular internally uses
// for `document.querySelectorAll(selector)` in our index.html
// where, in this case, selector is the string 'app'
selector: 'app', // <app></app>
// Every Angular template is first compiled by the browser before Angular runs it's compiler
template: `
<header>
<h1>Hello {{ app.title }}</h1>
</header>
<main>
Your Content Here
<div>
<input type="text" ng-model="title" autofocus>
</div>
<pre>this.title = {{ app.title | json }}</pre>
<pre>this.data = {{ app.data | json }}</pre>
</main>
`
})
export class App {
// These are member type
title: string;
data: Array<any> = []; // default data
constructor() {
this.title = 'ng-forward';
}
}