The front end in this direction, the ability to accept new things and speed determines your position in the entire industry.
NG2 has not yet released the official stable version, but I think for me this time is the best time to store, so began to ng2 the road of learning.
Contact with Ng2 before also contact with a Avalon things, but do not know where the phase grams, is not smooth, and then think, are the same, and learn more reference to the NG2.
NG2 support Typescript and es5,6 development, of course, the official document currently only TS, in order to get started faster, have to use TS to write, so there is a problem is: compile.
Build Tools is gulp, so began to find gulp on the compiler TS Plug-ins, there are some, this thought will not go what fork, but this place was entangled for some time. It seems that I really need more discipline.
To get to the point:
The final selection of TS compiler plug-ins: Gulp-typescript.
The official explanation is very detailed, not much to repeat, the main details:
1: Define module loading mechanism
"Module": "Commonjs"
Gulp is the building tool under node, so the module loading mechanism also uses node mechanism, otherwise it will prompt the following error
Error Ts1148:cannot compile modules unless the '--module ' flag is provided.
Error Ts2307:cannot find module ' angular2/angular2 '.
Error Ts2307:cannot find module ' angular2/http '.
2: Define compilation target Type
"Target": "ES5"
To convert TS to ES5 standard files, node hints can be higher, but the actual operation of the experiment is not feasible.
3: Avoid warning
' Experimentaldecorators ': true
This item is not configured and prompts for warnings, causing the compilation to be unsuccessful
Error ts1219:experimental support for decorators is a feature this is subject to the change in a future release. Specify '--experimentaldecorators ' to remove this warning.