原创 angular this vs $scope (How does 'this' and $scope work in AngularJS controllers?)

"How does 'this' and $scope work in AngularJS controllers?" Short answer: this When the controller constructor fun

原创 dynamic change content of bootstrap tooltip or popover

f you grab the popover instance like this: var popover = $('.reply').data('bs.popover'); Then, to redraw the popover,

原创 angular scope of directive

在這之前希望你對AngularJS的Directive有一定的瞭解,不然你對下面部分的理解可能會有一點難度。 步入正題: 每當一個指令被創建的時候,都會有這樣一個選擇,是繼承自己的父作用域(一般是外部的Controller提供的作用

原创 Angular ui-grid 2.0 與 3.0 版本區別

這兩天用到了Angular的ui-grid插件。網上能搜到的教程基本上是基於2.0版本的,現把3.0版本的不同點列出來,以免入坑。 Upgrading from 2.x to 3.0 ui-grid 3.0 is a substan

原创 angular 封裝 Jquery插件時作用域問題

今天在封裝一個Jquery插件的時候,在用jquery處理綁定事件時需要訪問scope去更新綁定model的值,<span style="font-size:32px;color:#ff0000;">使用$.proxy在將事件的上下文改

原创 javascript toString.call()

The toString() method returns a string representing object. Syntax obj.toString() Description Every object has a t

原创 “Thinking in AngularJS” if I have a jQuery background?

1. Don't design your page, and then change it with DOMmanipulations In jQuery, you design a page, and then you make i

原创 Angular controller, services, scopes fundamental concept

Controller: Use controllers to: Set up the initial state of the $scope object.Add behavior to the $scope object. Do n

原创 應用程序結構的LIFT準則

原文http://www.reqianduan.com/1722.html 應用程序結構的LIFT準則 LIFT [Style Y140] 構建一個可以快速定位(Locate)代碼、一目瞭然地識別(Identify)代碼、擁有一

原创 java session 監聽

相應的在web.xml配置 <listener> <listener-class>....essionHandler</listener-class> </listener>public class SessionHandle

原创 for循環 i 閉包

for (var i = 0; i < len - 1; i++) { (function(i) { <span style="white-space:pre"> </span>//do anything

原创 JavaScript 異步編程 與異步式I/O

和JavaSript線程異步同步相同的還有  對I/O的處理。 I/O的處理包括同步式I/O(阻塞式I/O) 與 異步式I/O(非阻塞式I/O)。 什麼是阻塞(block)呢?線程在執行中如果遇到磁盤讀寫或網絡通信(統稱爲 I/O

原创 更改angular $http post 默認json

By default, the $http service will transform the outgoing request by serializing the data as JSON and then posting it

原创 angular compile vs link vs controller

compile function - use for template DOM manipulation (i.e., manipulation of tElement = template element), hence manip

原创 angular controller 依賴聲明

依賴聲明 INJECTOR如何知道需要給組件提供那些依賴? 程序的開發人員需要明確的聲明依賴以便injector決定如何解決依賴關係。在Angular中,有三種方式可以聲明一個組件所依賴的服務: 隱式的從函數參數名中推斷 使用$i