@ -18,7 +18,7 @@ const moduleInjection = {}, moduleInjectionMap = {
export function module ( xtype , cls ) {
if ( isNotNull ( moduleInjection [ xtype ] ) ) {
_global . console && console . error ( ` module: [ ${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` module: [ ${ xtype } ] already registered ` ) ;
} else {
if ( isFunction ( cls ) ) {
cls = cls ( ) ;
@ -48,7 +48,7 @@ export function module(xtype, cls) {
const constantInjection = { } ;
export function constant ( xtype , cls ) {
if ( isNotNull ( constantInjection [ xtype ] ) ) {
_global . console && console . error ( ` constant: [ ${ xtype } ]已经注册过了 ` ) ;
_global . console && console . error ( ` constant: [ ${ xtype } ]already registered ` ) ;
} else {
constantInjection [ xtype ] = cls ;
}
@ -59,7 +59,7 @@ export function constant(xtype, cls) {
const modelInjection = { } ;
export function model ( xtype , cls ) {
if ( isNotNull ( modelInjection [ xtype ] ) ) {
_global . console && console . error ( ` model: [ ${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` model: [ ${ xtype } ] already registered ` ) ;
} else {
modelInjection [ xtype ] = cls ;
}
@ -70,7 +70,7 @@ export function model(xtype, cls) {
const storeInjection = { } ;
export function store ( xtype , cls ) {
if ( isNotNull ( storeInjection [ xtype ] ) ) {
_global . console && console . error ( ` store: [ ${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` store: [ ${ xtype } ] already registered ` ) ;
} else {
storeInjection [ xtype ] = cls ;
}
@ -81,7 +81,7 @@ export function store(xtype, cls) {
const serviceInjection = { } ;
export function service ( xtype , cls ) {
if ( ( serviceInjection [ xtype ] ) ) {
_global . console && console . error ( ` service: [ ${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` service: [ ${ xtype } ] already registered ` ) ;
}
serviceInjection [ xtype ] = cls ;
@ -92,7 +92,7 @@ export function service(xtype, cls) {
const providerInjection = { } ;
export function provider ( xtype , cls ) {
if ( ( providerInjection [ xtype ] ) ) {
_global . console && console . error ( ` provider: [ ${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` provider: [ ${ xtype } ] already registered ` ) ;
} else {
providerInjection [ xtype ] = cls ;
}
@ -145,7 +145,7 @@ const runConfigFunction = (type, configFn) => {
}
}
if ( findVersion === true ) {
_global . console && console . error ( ` moduleId: [ ${ module . moduleId } ] 接口 : [ ${ type } ] 接口版本 : [ ${ version } ] 已过期,版本要求为: ` , dependencies [ module . moduleId ] , "=>" , moduleInjection [ module . moduleId ] ) ;
_global . console && console . error ( ` moduleId: [ ${ module . moduleId } ] interface : [ ${ type } ] version : [ ${ version } ] has expired. The version requirement is: ` , dependencies [ module . moduleId ] , "=>" , moduleInjection [ module . moduleId ] ) ;
continue ;
}
}
@ -245,7 +245,7 @@ export function point(type, action, pointFn, after) {
export const Modules = {
getModule ( type ) {
if ( ! moduleInjection [ type ] ) {
_global . console && console . error ( ` module: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` module: [ ${ type } ] undefined ` ) ;
}
return moduleInjection [ type ] ;
@ -258,7 +258,7 @@ export const Modules = {
export const Constants = {
getConstant ( type ) {
if ( isNull ( constantInjection [ type ] ) ) {
_global . console && console . error ( ` constant: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` constant: [ ${ type } ] undefined ` ) ;
}
runConfigFunction ( type ) ;
@ -307,7 +307,7 @@ function callPoint(inst, types) {
export const Models = {
getModel ( type , config ) {
if ( ! modelInjection [ type ] ) {
_global . console && console . error ( ` model: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` model: [ ${ type } ] undefined ` ) ;
}
runConfigFunction ( type ) ;
const inst = new modelInjection [ type ] ( config ) ;
@ -323,7 +323,7 @@ const stores = {};
export const Stores = {
getStore ( type , config ) {
if ( ! storeInjection [ type ] ) {
_global . console && console . error ( ` store: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` store: [ ${ type } ] undefined ` ) ;
}
if ( stores [ type ] ) {
return stores [ type ] ;
@ -342,7 +342,7 @@ const services = {};
export const Services = {
getService : ( type , config ) => {
if ( ! serviceInjection [ type ] ) {
_global . console && console . error ( ` service: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` service: [ ${ type } ] undefined ` ) ;
}
if ( services [ type ] ) {
return services [ type ] ;
@ -359,7 +359,7 @@ const providers = {},
export const Providers = {
getProvider : ( type , config ) => {
if ( ! providerInjection [ type ] ) {
_global . console && console . error ( ` provider: [ ${ type } ] 未定义 ` ) ;
_global . console && console . error ( ` provider: [ ${ type } ] undefined ` ) ;
}
runConfigFunction ( type ) ;
if ( ! providers [ type ] ) {
@ -398,7 +398,7 @@ export const Actions = {
const kv = { } ;
export function shortcut ( xtype , cls ) {
if ( isNotNull ( kv [ xtype ] ) ) {
_global . console && console . error ( ` 组件: [${ xtype } ] 已经注册过了 ` ) ;
_global . console && console . error ( ` widget: [${ xtype } ] already registered ` ) ;
}
if ( cls ) {
cls . xtype = xtype ;
@ -413,7 +413,7 @@ const createRealWidget = (config, context, lazy) => {
const Cls = isFunction ( config . type ) ? config . type : kv [ config . type ] ;
if ( ! Cls ) {
throw new Error ( ` 组件: [${ config . type } ] 未定义 ` ) ;
throw new Error ( ` widget: [${ config . type } ] undefined ` ) ;
}
let pushed = false ;
const widget = new Cls ( ) ;
@ -495,7 +495,7 @@ export function createWidget(item, options, context, lazy) {
if ( isWidget ( item . el ) ) {
return item . el ;
}
throw new Error ( "组件:无法根据item创建组件 " , item ) ;
throw new Error ( "widget: Unable to create widget from item " , item ) ;
}
export function _lazyCreateWidget ( item , options , context ) {
@ -524,5 +524,5 @@ export function getResource(type, config) {
if ( providerInjection [ type ] ) {
return Providers . getProvider ( type , config ) ;
}
throw new Error ( ` 未知类型: [ ${ type } ] 未定义 ` ) ;
throw new Error ( "unknown type: [" + type + "] undefined" ) ;
}