本文整理汇总了TypeScript中@utils/obj.obj_getProperty函数的典型用法代码示例。如果您正苦于以下问题:TypeScript obj_getProperty函数的具体用法?TypeScript obj_getProperty怎么用?TypeScript obj_getProperty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了obj_getProperty函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: function
getExport: function(property) {
var obj = this.exports;
return property !== '*'
? obj_getProperty(obj, property)
: obj
;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:Module.ts
示例2: mask_config
export function mask_config (a?, b?, c?) {
var args = arguments,
length = args.length
if (length === 0) {
return __cfg;
}
if (length === 1) {
let x = args[0]
if (is_Object(x)) {
obj_extend(__cfg, x);
listeners_emit('config', x);
return;
}
if (is_String(x)) {
return obj_getProperty(__cfg, x);
}
}
if (length === 2) {
var prop = args[0];
if (obj_hasProperty(__cfg, prop) === false) {
log_warn('Unknown configuration property', prop);
}
let x = {};
obj_setProperty(x , prop, args[1]);
obj_setProperty(__cfg, prop, args[1]);
listeners_emit('config', x);
return;
}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:29,代码来源:config.ts
示例3: interpolate_
function interpolate_(path, placeholders, node) {
var index = path.indexOf('.');
if (index === -1) {
log_warn('Merge templates. Accessing node', path);
return null;
}
var tagName = path.substring(0, index),
id = tagName.substring(1),
property = path.substring(index + 1),
obj = null;
if (node != null) {
if (tagName === '@attr') {
return interpolate_getAttr_(node, placeholders, property);
}
else if (tagName === '@counter') {
return interpolate_getCounter_(property);
}
else if (tagName === node.tagName)
obj = node;
}
if (obj == null)
obj = placeholders.$getNode(id);
if (obj == null) {
//- log_error('Merge templates. Node not found', tagName);
return null;
}
return obj_getProperty(obj, property);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:merge.ts
示例4: obj_sub_notifyListeners
export function obj_sub_notifyListeners(obj, path, oldVal) {
var obs = obj[prop_OBS];
if (obs == null) return;
for (var prop in obs) {
if (prop.indexOf(path + '.') !== 0) continue;
var cbs = obs[prop].slice(0),
imax = cbs.length,
i = 0,
oldProp,
cb;
if (imax === 0) continue;
var val = obj_getProperty(obj, prop);
for (i = 0; i < imax; i++) {
cb = cbs[i];
obj_removeObserver(obj, prop, cb);
if (oldVal != null && typeof oldVal === 'object') {
oldProp = prop.substring(path.length + 1);
obj_removeObserver(oldVal, oldProp, cb);
}
}
for (i = 0; i < imax; i++) {
cbs[i](val);
}
for (i = 0; i < imax; i++) {
obj_addObserver(obj, prop, cbs[i]);
}
}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:notify.ts
示例5: obj_crumbRebind
function obj_crumbRebind(obj, path, oldValue) {
var obs = obj[prop_OBS];
if (obs == null) return;
for (var prop in obs) {
if (prop.indexOf(path) !== 0) continue;
var cbs = obs[prop].slice(0),
imax = cbs.length,
i = 0;
if (imax === 0) continue;
var val = obj_getProperty(obj, prop),
oldProp = prop.substring(path.length),
oldVal = obj_getProperty(oldValue, oldProp);
for (i = 0; i < imax; i++) {
var cb = cbs[i];
obj_removeObserver(obj, prop, cb);
if (oldValue != null && typeof oldValue === 'object') {
obj_removeObserver(oldValue, oldProp, cb);
}
}
if (oldVal !== val) {
for (i = 0; i < imax; i++) {
cbs[i](val);
}
}
for (i = 0; i < imax; i++) {
obj_addObserver(obj, prop, cbs[i]);
}
}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:36,代码来源:obj_crumbs.ts
示例6: m_cfg
export function m_cfg(mix, val){
if (arguments.length === 1) {
if (is_String(mix)) {
return obj_getProperty(_opts, mix);
}
if (is_Object(mix)) {
for (var key in mix) {
u_setOption(_opts, key, mix[key]);
}
}
return this;
}
u_setOption(_opts, mix, val);
return this;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:config.ts
示例7: compo_attach
export function compo_attach (compo: Component, name: string, fn: Function) {
var current = obj_getProperty(compo, name);
if (is_Function(current)) {
var wrapper = function(){
var args = _Array_slice.call(arguments);
fn.apply(compo, args);
current.apply(compo, args);
};
obj_setProperty(compo, name, wrapper);
return;
}
if (current == null) {
obj_setProperty(compo, name, fn);
return;
}
throw Error('Cann`t attach ' + name + ' to not a Function');
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:17,代码来源:compo.ts
示例8: function
validate: function(val, el, oncancel) {
var element = el == null ? this.element : el,
value = val;
if (arguments.length === 0) {
value = obj_getProperty(this.model, this.attr.value);
}
if (this.validators.length === 0) {
this.initValidators();
}
var fns = this.validators,
type = this.attr.silent ? 'validate' : 'validateUi'
;
return ValidatorProvider[type](
fns, value, this, element, oncancel
);
},
开发者ID:atmajs,项目名称:MaskJS,代码行数:17,代码来源:validate.ts
示例9: obj_unlockObservers
export function obj_unlockObservers(obj) {
var obs = obj[prop_OBS],
dirties = obs == null ? null : obs[prop_DIRTY];
if (dirties == null) return;
obs[prop_DIRTY] = null;
var prop, cbs, val, imax, i;
for (prop in dirties) {
cbs = obj[prop_OBS][prop];
imax = cbs == null ? 0 : cbs.length;
if (imax === 0) continue;
i = -1;
val = prop === prop_MUTATORS ? obj : obj_getProperty(obj, prop);
while (++i < imax) {
cbs[i](val);
}
}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:20,代码来源:obj_observe.ts
示例10: u_setOption
export function u_setOption (options, key, val) {
if (key === 'base' || key === 'nsBase') {
var path = path_normalize(val);
if (path[path.length - 1] !== '/') {
path += '/';
}
// Do not resolve root, as it will be resolved by base later
// @NextIteration: remove also path_resolveRoot, use instead resolveCurrent
// if (path[0] === '/') {
// path = path_combine(path_resolveRoot(), path);
// }
options[key] = path;
return this;
}
var current = obj_getProperty(options, key);
if (is_Object(current) && is_Object(val)) {
obj_extend(current, val);
return this;
}
obj_setProperty(options, key, val);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:21,代码来源:utils.ts
注:本文中的@utils/obj.obj_getProperty函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论