顯示具有 Web 標籤的文章。 顯示所有文章
顯示具有 Web 標籤的文章。 顯示所有文章

2014年9月18日 星期四

[AngularJS] Scope issues when using custom directive (用客製 directive 的 scope 注意事項)



當使用 AngularJS 客製化的 HTML 標籤 (Directive) 時,
要特別注意 Scope,下面敘述五種不同設定下的 Scope 差別。

預備知識

scope 和 transclude 的預設值皆為 false。

2014年9月17日 星期三

[HTML] The reason of using "for" attribute in "label" (label 內的 for 屬性用處)



用意是跟某 element 綁在一起。

比較常使用的方式是和 input 綁在一起,
點 label 時,就會讓 input 獲得 focus 。

2014年8月19日 星期二

[Javascript] Q (promise, defer) usage (Q 用法)



整理分享簡單用法。

可以參考 q 原始碼網頁 。

[NodeJs] npm package.json dependencies version (npm package 版本寫法整理)

version       Must match version exactly
>version     Must be greater than version
>=version   etc
<version
<=version
~version     "Approximately equivalent to version"
^version     "Compatible with version"
1.2.x           1.2.0, 1.2.1, etc., but not 1.3.0
http://...       See 'URLs as Dependencies' below
*                 Matches any version
""               (just an empty string) Same as *
version1 - version2         Same as >=version1 <=version2.
range1 || range2              Passes if either range1 or range2 are satisfied
git...            See 'Git URLs as Dependencies' below
user/repo    See 'GitHub URLs' below