Merge pull request #125 from jeffbcross/fixes-one
First round of guide content fixes
This commit is contained in:
commit
4a4a8d6e11
|
@ -40,28 +40,26 @@
|
||||||
p To see this working, create another file, <code>show-properties.ts</code>, and add the following:
|
p To see this working, create another file, <code>show-properties.ts</code>, and add the following:
|
||||||
|
|
||||||
code-tabs
|
code-tabs
|
||||||
code-pane(language="javascript" name="TypeScript" format="linenums" escape="html").
|
code-pane(language="javascript" name="TypeScript" format="linenums").
|
||||||
// TypeScript
|
// TypeScript
|
||||||
import {Component, View, bootstrap, For} from 'angular2/angular2';
|
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'display'
|
selector: 'display'
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
template: `
|
template: `
|
||||||
<p>My name: {{ myName }}</p>
|
<p>My name: {{ myName }}</p>
|
||||||
`,
|
`
|
||||||
directives: [For]
|
|
||||||
})
|
})
|
||||||
class DisplayComponent {
|
class DisplayComponent {
|
||||||
myName: string;
|
myName: string;
|
||||||
names: Array<string>;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.myName = "Alice";
|
this.myName = "Alice";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
code-pane(language="javascript" name="ES5" format="linenums" escape="html").
|
code-pane(language="javascript" name="ES5" format="linenums").
|
||||||
// ES5
|
// ES5
|
||||||
function DisplayComponent() {
|
function DisplayComponent() {
|
||||||
this.myName = "Alice";
|
this.myName = "Alice";
|
||||||
|
@ -72,8 +70,7 @@
|
||||||
}),
|
}),
|
||||||
new angular.ViewAnnotation({
|
new angular.ViewAnnotation({
|
||||||
template:
|
template:
|
||||||
'<p>My name: {{ myName }}</p>',
|
'<p>My name: {{ myName }}</p>'
|
||||||
directives: [angular.For, angular.If]
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -106,12 +103,12 @@
|
||||||
While you've used <code>template:</code> to specify an inline view, for larger templates you'd
|
While you've used <code>template:</code> to specify an inline view, for larger templates you'd
|
||||||
want to move them to a separate file and load them with <code>templateUrl:</code> instead.
|
want to move them to a separate file and load them with <code>templateUrl:</code> instead.
|
||||||
|
|
||||||
p So you can see Angular dynamically update content, add a line after
|
p To see Angular dynamically update content, add a line after
|
||||||
|
|
||||||
code-example(language="html" escape="html").
|
code-example(language="html" escape="html").
|
||||||
<p>My name: {{ myName }}</p>
|
<p>My name: {{ myName }}</p>
|
||||||
|
|
||||||
p to this:
|
p add this:
|
||||||
pre.prettyprint.lang-html
|
pre.prettyprint.lang-html
|
||||||
code.
|
code.
|
||||||
<p>Current time: {{ time }}</p>
|
<p>Current time: {{ time }}</p>
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
<script src="https://jspm.io/system@0.16.js"></script>
|
<script src="https://jspm.io/system@0.16.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-alpha.22/angular2.dev.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-alpha.22/angular2.dev.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -143,8 +142,8 @@
|
||||||
|
|
||||||
p.
|
p.
|
||||||
The root component's job is to give a location in the <code>index.html</code> file where your application will
|
The root component's job is to give a location in the <code>index.html</code> file where your application will
|
||||||
render through it's element, in this case <code><my-app></code>. There is also nothing special about this
|
render through its element, in this case <code><my-app></code>. There is also nothing special about this
|
||||||
element name and you can pick it as you like.
|
element name; you can pick it as you like.
|
||||||
|
|
||||||
p.
|
p.
|
||||||
The root component loads the initial template for the application that will load other components to perform
|
The root component loads the initial template for the application that will load other components to perform
|
||||||
|
|
Loading…
Reference in New Issue