diff --git a/src/core/6.inject.js b/src/core/6.inject.js index ed4d1165b..c9f77055b 100644 --- a/src/core/6.inject.js +++ b/src/core/6.inject.js @@ -39,6 +39,9 @@ _global.console && console.error("constant: [" + xtype + "]已经注册过了"); } constantInjection[xtype] = cls; + return function () { + return BI.Constants.getConstant(xtype); + } }; var modelInjection = {}; @@ -47,6 +50,9 @@ _global.console && console.error("model: [" + xtype + "] 已经注册过了"); } modelInjection[xtype] = cls; + return function (xtype, config) { + return BI.Models.getModel(xtype, config); + }; }; var storeInjection = {}; @@ -55,6 +61,9 @@ _global.console && console.error("store: [" + xtype + "] 已经注册过了"); } storeInjection[xtype] = cls; + return function (xtype, config) { + return BI.Stores.getStore(xtype, config); + } }; var serviceInjection = {}; @@ -63,6 +72,9 @@ _global.console && console.error("service: [" + xtype + "] 已经注册过了"); } serviceInjection[xtype] = cls; + return function (xtype, config) { + return BI.Services.getService(xtype, config); + } }; var providerInjection = {}; @@ -71,6 +83,9 @@ _global.console && console.error("provider: [" + xtype + "] 已经注册过了"); } providerInjection[xtype] = cls; + return function (xtype, config) { + return BI.Providers.getProvider(xtype, config); + } }; var configFunctions = {}; @@ -294,7 +309,7 @@ _global.console && console.error("constant: [" + type + "] 未定义"); } runConfigFunction(type); - return constantInjection[type]; + return BI.isFunction(constantInjection[type]) ? constantInjection[type]() : constantInjection[type]; } };