5. うちの会社はAngularJS1.2を使って開発しています。
どうやらAngularJS2.0の開発は…
All code in AngularJS 2 is already being written in ES6. As ES6 doesn’t
run in browsers today, we’re using the Traceur compiler to generate the
nice ES5 that runs everywhere. We’re working with the Traceur team to
build support for a few extensions like annotations and assertions. We
call this set of extensions "ES6 +A".
http://blog.angularjs.org/2014/03/angular-20.html
次の2は Traceurつかって開発してるよ〜
11. ECMAScript6とは
Mozilla における ECMAScript 6 のサポートより
https://developer.mozilla.org/ja/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla
"
”
ECMAScript 6 は "Harmony" または "ES.next" のコードネームで呼称される、
"
JavaScript の次期標準仕様です。
TC39 has decided to move the formal publication date of the
ECMAScript 6 standard to June 2015.
http://www.2ality.com/2014/06/es6-schedule.html
仕様確定は来年の6月みたい。来年は盛り上がるかも。
20. // thisの動きが違うよ
var ore = {name: "nobio"};
ore.sayEs5 = function () {
var getName = function () {
return this.name;
};
return "My name is " + getName();
}
ore.sayEs6 = function () {
var getName = ()=> this.name;
return "My name is " + getName();
};
console.log("ore.sayEs5()=", ore.sayEs5());
console.log("ore.sayEs6()=", ore.sayEs6());
ore.sayEs5()= My name is
ore.sayEs6()= My name is nobio
"
function(){}の中のthisは新た
に作られるんですけど
"
=>は外のthisが
使えます!