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 。