Mainly Devel Notes

Twitter, GitHub, StackOverflow: @ovrmrw (short hand of "overmorrow" that means the day after tomorrow)

Very first step of Knockout on Node + Express

English:
This is very first step guide for using Knockout(+ko.punches plugin) on Node+Express.
You have to have a environment of Yeoman.
In this case I write JavaScript file with TypeScript style.

  1. "yo express" (view engine is EJS)
  2. Put a new TypeScript file to /public/js/ folder named first.ts and edit it as my Gist.
  3. Edit footer.ejs and index.ejs as my Gist.
  4. Of course you have to compile TypeScript files before "grunt".
  5. "grunt" --> http://localhost:3000/ --> Oh, your Knockout is working :)

Japanese:
KnockoutをNode+Expressの環境で使うとても初歩的なガイドです。(ko.punchesプラグインも登場します)
先にYeomanの環境が整っている必要があります。
今回はTypeScriptを使ってJavaScriptファイルを作成します。

  1. "yo express"を実行します。view engineはEJSで。
  2. /public/js/フォルダーに first.ts という名前でTypeScriptファイルを作成し、私のGistコードのように入力してください。
  3. footer.ejsindex.ejs を私のGistコードのように変更してください。
  4. 当然ですがTypeScriptファイルはコンパイルしておきましょう。
  5. "grunt"を実行します。http://localhost:3000/ にアクセスするとKnockoutが動作していることがわかるでしょう。

sample: Knockout in Node+Express