Browse Source

BI-61560 refactor: 提供mixin的注册key埋点

master
windy 5 years ago
parent
commit
13ea18b9e7
  1. 6
      src/core/inject.js

6
src/core/inject.js

@ -143,7 +143,9 @@
}
};
var callPoint = function (inst, type) {
var callPoint = function (inst, types) {
types = BI.isArray(types) ? types : [types];
BI.each(types, function (idx, type) {
if (points[type]) {
for (var action in points[type]) {
var bfns = points[type][action].before;
@ -176,12 +178,14 @@
}
}
}
});
};
BI.Models = {
getModel: function (type, config) {
var inst = new modelInjection[type](config);
inst._constructor && inst._constructor(config);
inst.mixins && callPoint(inst, inst.mixins);
callPoint(inst, type);
return inst;
}

Loading…
Cancel
Save