added some es6

This commit is contained in:
Donnelly 2017-03-28 11:52:39 +01:00
parent 5df177c10e
commit 1a0fc00f46
3 changed files with 23 additions and 15 deletions

View File

@ -96,7 +96,7 @@
aurelia.start().then(() => aurelia.setRoot());
}
```
```
---
```typescript
@ -112,8 +112,9 @@
}
```
<code-listing heading="Installing a Plugin">
<source-code lang="ES 2015/2016">
### Installing a Plugin
```javascript
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
@ -122,8 +123,10 @@
aurelia.start().then(() => aurelia.setRoot());
}
</source-code>
<source-code lang="TypeScript">
```
---
```typescript
import {Aurelia} from 'aurelia-framework';
export function configure(aurelia: Aurelia): void {
@ -134,38 +137,43 @@
aurelia.start().then(() => aurelia.setRoot());
}
</source-code>
</code-listing>
```
## [Creating Components](aurelia-doc://section/2/version/1.0.0)
UI components consist of two parts: a view-model and a view. Simply create each part in its own file. Use the same file name but different file extensions for the two parts. For example: _hello${context.language.fileExtension}_ and _hello.html_.
<code-listing heading="Explicit Configuration">
<source-code lang="ES 2015">
### Explicit Configuration
###### ES 2015
```javascript
import {useView, decorators} from 'aurelia-framework';
export let Hello = decorators(useView('./hello.html')).on(class {
...
});
</source-code>
<source-code lang="ES 2016">
```
###### ES 2016
```javascript
import {useView} from 'aurelia-framework';
@useView('./hello.html')
export class Hello {
...
}
</source-code>
<source-code lang="TypeScript">
```
###### Typescript
```typescript
import {useView} from 'aurelia-framework';
@useView('./hello.html')
export class Hello {
...
}
</source-code>
</code-listing>
```
#### The Component Lifecycle

View File

View File