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:
|
||||
|
||||
code-tabs
|
||||
code-pane(language="javascript" name="TypeScript" format="linenums" escape="html").
|
||||
code-pane(language="javascript" name="TypeScript" format="linenums").
|
||||
// TypeScript
|
||||
import {Component, View, bootstrap, For} from 'angular2/angular2';
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'display'
|
||||
})
|
||||
@View({
|
||||
template: `
|
||||
<p>My name: {{ myName }}</p>
|
||||
`,
|
||||
directives: [For]
|
||||
<p>My name: {{ myName }}</p>
|
||||
`
|
||||
})
|
||||
class DisplayComponent {
|
||||
myName: string;
|
||||
names: Array<string>;
|
||||
|
||||
constructor() {
|
||||
this.myName = "Alice";
|
||||
}
|
||||
}
|
||||
code-pane(language="javascript" name="ES5" format="linenums" escape="html").
|
||||
code-pane(language="javascript" name="ES5" format="linenums").
|
||||
// ES5
|
||||
function DisplayComponent() {
|
||||
this.myName = "Alice";
|
||||
|
@ -72,8 +70,7 @@
|
|||
}),
|
||||
new angular.ViewAnnotation({
|
||||
template:
|
||||
'<p>My name: {{ myName }}</p>',
|
||||
directives: [angular.For, angular.If]
|
||||
'<p>My name: {{ myName }}</p>'
|
||||
})
|
||||
];
|
||||
|
||||
|
@ -106,12 +103,12 @@
|
|||
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.
|
||||
|
||||
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").
|
||||
<p>My name: {{ myName }}</p>
|
||||
|
||||
p to this:
|
||||
p add this:
|
||||
pre.prettyprint.lang-html
|
||||
code.
|
||||
<p>Current time: {{ time }}</p>
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<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>
|
||||
</head>
|
||||
|
@ -143,8 +142,8 @@
|
|||
|
||||
p.
|
||||
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
|
||||
element name and you can pick it as you like.
|
||||
render through its element, in this case <code><my-app></code>. There is also nothing special about this
|
||||
element name; you can pick it as you like.
|
||||
|
||||
p.
|
||||
The root component loads the initial template for the application that will load other components to perform
|
||||
|
|
Loading…
Reference in New Issue