added some es6
This commit is contained in:
parent
5df177c10e
commit
1a0fc00f46
@ -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
|
||||
|
||||
|
0
cheatfiles/es6-cheatsheet.md
Normal file
0
cheatfiles/es6-cheatsheet.md
Normal file
0
cheatfiles/es6-features.md
Normal file
0
cheatfiles/es6-features.md
Normal file
Loading…
Reference in New Issue
Block a user