LoginSignup
0
0

More than 5 years have passed since last update.

Aurelia翻訳ログ (docs.html 4/13 line1 to 242)

Last updated at Posted at 2015-04-12

前回に引き続き、現行日本語版と最新のdocs.htmlの違いについて紹介します。なお、ソースコードはdocs.html からの引用です。

docs.htmlの変更 (4/13)wi

IE9対応

Aureliaは何もしなければIE11からの対応ですが、IE9以上で動かす方法がドキュメントに追加されました。MutationObserverとWeakMap(MutationObserverが依存している)をjspmでインストールし、system.js の前に読み込めばいいそうです。

> jspm install "github:webreflection/es6-collections"
> jspm install "github:github:polymer/mutationobservers"

index.htmlで、

<script src="jspm_packages/github/webreflection/es6-collections@master/es6-collections.js"></script>
<script src="jspm_packages/github/polymer/mutationobservers@0.4.2/MutationObserver.js"></script>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
  System.import('aurelia-bootstrapper');
</script>

aurelia.use.es5()

今までES5を使う場合にはconfigureで aurelia.use.es5() を呼べと書いてありましたが、無くなっています。必要なくなったのかな。

decoratorが使えないとき: Decoratorsヘルパ

CoffeeScriptなど、decoratorが使えない場合のために、Decoratorsヘルパが用意されています。これをdecoratorsスタティックプロパティ、もしくはスタティックメソッドで宣言するだけです。

HttpClient = require('aurelia-http-client').HttpClient;
Decorators = require('aurelia-framework').Decorators;

class CustomerDetail
  constructor: (@http) ->
  @decorators:Decorators.transient().inject(HttpClient);

現行のTypeScriptで使う場合もこちらでいけそうですね。

Attached Behavior から Custom Attributeへ

Aureliaにはカスタムタグの他に、属性を追加することも出来ますが、これを今までは "Attached Behavior" と呼んでいました。これが、いつのまにかCustom Attributeになったようです。挙動が変わったのか、経緯は後で調べてみようと思いますが、ビヘイビアって翻訳しづらかったので(字面から意味がわからないという意味で)、ありがたい変更でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0