some mods

This commit is contained in:
Donnelly 2017-03-28 11:13:58 +01:00
parent 880bca423c
commit 108a365717

View File

@ -1,10 +1,9 @@
#Aurelia Cheat Sheet
# Aurelia Cheat Sheet
## [Configuration and Startup](aurelia-doc://section/1/version/1.0.0)
### Bootstrapping Older Browsers
```html
<code-listing heading="Bootstrapping Older Browsers">
<source-code lang="HTML">
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
@ -14,15 +13,12 @@
SystemJS.import('aurelia-bootstrapper');
});
</script>
</source-code>
</code-listing>
```
> Warning: Promises in Edge
> Currently, the Edge browser has a serious performance problem with its Promise implementation. This deficiency can greatly increase startup time of your app. If you are targeting the Edge browser, it is highly recommended that you use the [bluebird promise](http://bluebirdjs.com/docs/getting-started.html) library to replace Edge's native implementation. You can do this by simply referencing the library prior to loading system.js.
<code-listing heading="Standard Startup Configuration">
<source-code lang="ES 2015/2016">
### Standard Startup Configuration
```javascript
export function configure(aurelia) {
aurelia.use
@ -32,9 +28,9 @@
aurelia.start().then(() => aurelia.setRoot());
}
```
</source-code>
<source-code lang="TypeScript">
```typescript
---
```typescript
import {Aurelia} from 'aurelia-framework';
export function configure(aurelia: Aurelia): void {
@ -45,11 +41,10 @@
aurelia.start().then(() => aurelia.setRoot());
}
```
</source-code>
</code-listing>
<code-listing heading="Explicit Startup Configuration">
<source-code lang="ES 2015/2016">
### Explicit Startup Configuration
```javascript
import {LogManager} from 'aurelia-framework';
import {ConsoleAppender} from 'aurelia-logging-console';
@ -66,8 +61,12 @@
aurelia.start().then(() => aurelia.setRoot('app', document.body));
}
</source-code>
<source-code lang="TypeScript">
```
---
```typescript
import {LogManager, Aurelia} from 'aurelia-framework';
import {ConsoleAppender} from 'aurelia-logging-console';
@ -84,11 +83,10 @@
aurelia.start().then(() => aurelia.setRoot('app', document.body));
}
</source-code>
</code-listing>
```
<code-listing heading="Configuring A Feature">
<source-code lang="ES 2015/2016">
### Configuring A Feature
```jaavascript
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
@ -97,8 +95,10 @@
aurelia.start().then(() => aurelia.setRoot());
}
</source-code>
<source-code lang="TypeScript">
```
---
```typescript
import {Aurelia} from 'aurelia-framework';
export function configure(aurelia: Aurelia): void {
@ -109,8 +109,7 @@
aurelia.start().then(() => aurelia.setRoot());
}
</source-code>
</code-listing>
```
<code-listing heading="Installing a Plugin">
<source-code lang="ES 2015/2016">