How is Aggregation designed
生活随笔
收集整理的這篇文章主要介紹了
How is Aggregation designed
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我的sample code: 最后是framework debug
<html> <script>function Aggregation(name) { this.mAggregationName = name; }var oItemAgg = new Aggregation("item"); // so far, Aggregation oject has no available methoddebugger;Aggregation.prototype.generate = function(add, prototype) { var that = this, n = that.mAggregationName;add("getAggregation", prototype, function() { console.log(" getAggregation should be implemented here!"); }); }function add(name, proto, fn){ if ( !proto[name] ) { proto[name] = fn; } }oItemAgg.generate(add, Aggregation.prototype);oItemAgg.getAggregation();debugger; </script>這里的bindItem實際上不是一個function,而是Javascript對象的一個attribute,該attribute指向了一個匿名函數,其實現是 this.bindAggregation(n, o, t, s,f)
總結
以上是生活随笔為你收集整理的How is Aggregation designed的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Require Busy dialog
- 下一篇: attachment绑相对url