Merge pull request #125 from jeffbcross/fixes-one

First round of guide content fixes
This commit is contained in:
Alex Wolfe 2015-05-19 13:46:00 -07:00
commit 4a4a8d6e11
2 changed files with 10 additions and 14 deletions

View File

@ -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: `
&lt;p&gt;My name: {{ myName }}&lt;/p&gt &lt;p&gt;My name: {{ myName }}&lt;/p&gt;
`, `
directives: [For]
}) })
class DisplayComponent { class DisplayComponent {
myName: string; myName: string;
names: Array&lt;string&gt;;
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:
'&lt;p&gt;My name: {{ myName }}&lt;/p&gt;', '&lt;p&gt;My name: {{ myName }}&lt;/p&gt;'
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.
&lt;p&gt;Current time: {{ time }}&lt;/p&gt; &lt;p&gt;Current time: {{ time }}&lt;/p&gt;

View File

@ -44,7 +44,6 @@
&lt;!DOCTYPE html&gt; &lt;!DOCTYPE html&gt;
&lt;html&gt; &lt;html&gt;
&lt;head&gt; &lt;head&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;
&lt;script src=&quot;https://jspm.io/system@0.16.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;https://jspm.io/system@0.16.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://code.angularjs.org/2.0.0-alpha.22/angular2.dev.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;https://code.angularjs.org/2.0.0-alpha.22/angular2.dev.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt; &lt;/head&gt;
@ -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>&lt;my-app&gt;</code>. There is also nothing special about this render through its element, in this case <code>&lt;my-app&gt;</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