How is Aggregation designed
is How Aggregation
2023-09-14 09:02:42 时间
我的sample code: 最后是framework debug
<html>
<script>
function Aggregation(name) {
this.mAggregationName = name;
}
var oItemAgg = new Aggregation("item"); // so far, Aggregation oject has no available method
debugger;
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)
相关文章
- Item is not readable svn: 条目不可读
- 【COCOS2DX-LUA 脚本开发之七】解决( ERROR IN FUNCTION ‘ADDCHILD’. ARGUMENT #2 IS ‘XX’; ‘CCNODE’ EXPECTED. )异常报错的方法
- [Java] Check a Database call return value is empty list
- Follow me to learn what is repository pattern
- how is SAP UI5 Model.setProperty implemented
- How is JerryMaster.view.xml being loaded in WebIDE local test environment
- how is navigation list item click event handled - actually no logic done
- when component is created twice - still no hint finally
- how drop down list description is displayed by UI framework
- How SAP concrete schema id is got based on transaction type plus catalog type
- how is webdynpro component class initialized
- How to judge if one OData model data is out of date
- How do I know that Association is internally implemented by inner join or outer association
- SAP Fiori Elements - smart control demo1 currency field - how is manifest.json loaded
- Why close date in S2 view is not displayed correctly after clicking it
- How SAP Fiori application is embedded in web client ui
- How is a Batch request handled in the backend
- 已解决UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected
- 已解决Warning: Integer display width is deprecated and will be removed in a future release.
- idea - 警告 The IDE is running low on memory and this might affect performance. Please consider increasing available heap. 解决
- The authenticity of host 'slaver2 (192.168.199.132)' can't be established. RSA key fingerprint is cc:4e:23:01:ca:97:52:21:85:78:bc:29:ca:b3:12:52.
- 华为运营商级路由器配置示例 | L3VdPdNd over IS-IS SR-MPLS Flex-Algo LSP基于亲和属性算路
- 解决办法:Python3.x UserWarning: Could not import the lzma module. Your installed Python is incomplete
- 【Transformer】15、PoolFormer: MetaFormer is Actually What You Need for Vision
- 1.4 为什么深度学习会兴起?(Why is Deep Learning taking off?)
- Linux超级超级管理pkexec权限完美解决/etc/sudoers、/etc/sudoers.d is world writable和kex_exchange