|
40 | 40 | p To see this working, create another file, <code>show-properties.ts</code>, and add the following:
|
41 | 41 |
|
42 | 42 | code-tabs
|
43 |
| - code-pane(language="javascript" name="TypeScript" format="linenums" escape="html"). |
| 43 | + code-pane(language="javascript" name="TypeScript" format="linenums"). |
44 | 44 | // TypeScript
|
45 |
| - import {Component, View, bootstrap, For} from 'angular2/angular2'; |
| 45 | + import {Component, View, bootstrap} from 'angular2/angular2'; |
46 | 46 |
|
47 | 47 | @Component({
|
48 | 48 | selector: 'display'
|
49 | 49 | })
|
50 | 50 | @View({
|
51 | 51 | template: `
|
52 |
| - <p>My name: {{ myName }}</p> |
53 |
| - `, |
54 |
| - directives: [For] |
| 52 | + <p>My name: {{ myName }}</p> |
| 53 | + ` |
55 | 54 | })
|
56 | 55 | class DisplayComponent {
|
57 | 56 | myName: string;
|
58 |
| - names: Array<string>; |
59 | 57 |
|
60 | 58 | constructor() {
|
61 | 59 | this.myName = "Alice";
|
62 | 60 | }
|
63 | 61 | }
|
64 |
| - code-pane(language="javascript" name="ES5" format="linenums" escape="html"). |
| 62 | + code-pane(language="javascript" name="ES5" format="linenums"). |
65 | 63 | // ES5
|
66 | 64 | function DisplayComponent() {
|
67 | 65 | this.myName = "Alice";
|
|
72 | 70 | }),
|
73 | 71 | new angular.ViewAnnotation({
|
74 | 72 | template:
|
75 |
| - '<p>My name: {{ myName }}</p>', |
76 |
| - directives: [angular.For, angular.If] |
| 73 | + '<p>My name: {{ myName }}</p>' |
77 | 74 | })
|
78 | 75 | ];
|
79 | 76 |
|
|
106 | 103 | While you've used <code>template:</code> to specify an inline view, for larger templates you'd
|
107 | 104 | want to move them to a separate file and load them with <code>templateUrl:</code> instead.
|
108 | 105 |
|
109 |
| - p So you can see Angular dynamically update content, add a line after |
| 106 | + p To see Angular dynamically update content, add a line after |
110 | 107 |
|
111 | 108 | code-example(language="html" escape="html").
|
112 | 109 | <p>My name: {{ myName }}</p>
|
113 | 110 |
|
114 |
| - p to this: |
| 111 | + p add this: |
115 | 112 | pre.prettyprint.lang-html
|
116 | 113 | code.
|
117 | 114 | <p>Current time: {{ time }}</p>
|
|
0 commit comments