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


[Tool] Markdown Syntax (Markdown 常用語法)



這篇最原始版本是三月多用Trello時整理的,
有些blog,像是Logdown。

來分享給大家~

 Header 

ABC
===

ABC
---

#一級字
##二級字
###h3
######h6

2014年6月10日 星期二

[Android] 照相

官方範例檔:PhotoIntentActivity.zip

一、設定權限

<manifest ... >
    <uses-feature android:name="android.hardware.camera" />
    ...
</manifest>

如果也要限制有相機的手機才能下載這個 App ,
則改寫成下面這樣:
<manifest ... >
    <uses-feature android:name="android.hardware.camera"
                  android:required="true" />
    ...
</manifest>


[Android] 分享/寄送訊息到其他的 App ( Line 、 Facebook Messenger 等)

加入下面這個function,
然後要用的地方呼叫它就行囉~

private void sendTextToOtherApp(String text) {
    Intent sendIntent = new Intent();
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT, text);
    sendIntent.setType("text/plain");
    startActivity(Intent.createChooser(sendIntent, "Send text to..."));
}



例如: