How is Aggregation designed
生活随笔
收集整理的這篇文章主要介紹了
How is Aggregation designed
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
我的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實(shí)際上不是一個(gè)function,而是Javascript對(duì)象的一個(gè)attribute,該attribute指向了一個(gè)匿名函數(shù),其實(shí)現(xiàn)是 this.bindAggregation(n, o, t, s,f)
總結(jié)
以上是生活随笔為你收集整理的How is Aggregation designed的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Require Busy dialog
- 下一篇: 荣耀20充电功率(荣耀官网荣耀手机)