本文整理汇总了TypeScript中angular2/src/facade/collection.StringMapWrapper类的典型用法代码示例。如果您正苦于以下问题:TypeScript StringMapWrapper类的具体用法?TypeScript StringMapWrapper怎么用?TypeScript StringMapWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringMapWrapper类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: transform
transform(value: string, mapping: {[key: string]: string}): string {
if (!isStringMap(mapping)) {
throw new InvalidPipeArgumentException(I18nSelectPipe, mapping);
}
return StringMapWrapper.contains(mapping, value) ? mapping[value] : mapping['other'];
}
开发者ID:JavaScript-Resource,项目名称:angular,代码行数:7,代码来源:i18n_select_pipe.ts
示例2: classSetterFactory
function classSetterFactory(className) {
var setterFn = StringMapWrapper.get(classSettersCache, className);
var dashCasedClassName;
if (isBlank(setterFn)) {
dashCasedClassName = camelCaseToDashCase(className);
setterFn = function(element, value) {
if (value) {
DOM.addClass(element, dashCasedClassName);
} else {
DOM.removeClass(element, dashCasedClassName);
}
};
StringMapWrapper.set(classSettersCache, className, setterFn);
}
return setterFn;
}
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:16,代码来源:property_setter_factory.ts
示例3: MockStep
new MockStep((parent, current, control) => {
if (isPresent(propertyBindings)) {
StringMapWrapper.forEach(propertyBindings, (ast, name) => {
current.bindElement().bindProperty(name, ast);
});
}
}),
开发者ID:goderbauer,项目名称:angular,代码行数:7,代码来源:directive_parser_spec.ts
示例4: _reduceControls
/** @internal */
_reduceControls(controlsConfig: any): {[key: string]: modelModule.AbstractControl} {
var controls: {[key: string]: modelModule.AbstractControl} = {};
StringMapWrapper.forEach(controlsConfig, (controlConfig, controlName) => {
controls[controlName] = this._createControl(controlConfig);
});
return controls;
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:8,代码来源:form_builder.ts
示例5: describe
describe(): StringMap<string, any> {
var res = {
'scriptTime': 'script execution time in ms, including gc and render',
'pureScriptTime': 'script execution time in ms, without gc nor render'
};
if (this._perfLogFeatures.render) {
res['renderTime'] = 'render time in ms';
}
if (this._perfLogFeatures.gc) {
res['gcTime'] = 'gc time in ms';
res['gcAmount'] = 'gc amount in kbytes';
res['majorGcTime'] = 'time of major gcs in ms';
if (this._forceGc) {
res['forcedGcTime'] = 'forced gc time in ms';
res['forcedGcAmount'] = 'forced gc amount in kbytes';
}
}
if (this._captureFrames) {
res['meanFrameTime'] = this._perfLogFeatures.frameCapture ?
'mean frame time in ms (target: 16.6ms for 60fps)' :
'WARNING: Metric requested, but not supported by driver';
}
StringMapWrapper.forEach(this._microMetrics,
(desc, name) => { StringMapWrapper.set(res, name, desc); });
return res;
}
开发者ID:B-Thapa,项目名称:angular,代码行数:26,代码来源:perflog_metric.ts
示例6: _serializeParams
function _serializeParams(params: {[key: string]: string}): string {
let res = "";
if (isPresent(params)) {
StringMapWrapper.forEach(params, (v, k) => res += `;${k}=${v}`);
}
return res;
}
开发者ID:844496869,项目名称:angular,代码行数:7,代码来源:segments.ts
示例7: _mergeErrors
static _mergeErrors(control, res) {
StringMapWrapper.forEach(control.errors, (value, error) => {
if (!StringMapWrapper.contains(res, error)) {
res[error] = [];
}
ListWrapper.push(res[error], control);
});
}
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:8,代码来源:validators.ts
示例8: equalSegments
export function equalSegments(a: RouteSegment, b: RouteSegment): boolean {
if (isBlank(a) && !isBlank(b)) return false;
if (!isBlank(a) && isBlank(b)) return false;
if (a._type !== b._type) return false;
if (isBlank(a.parameters) && !isBlank(b.parameters)) return false;
if (!isBlank(a.parameters) && isBlank(b.parameters)) return false;
return StringMapWrapper.equals(a.parameters, b.parameters);
}
开发者ID:844496869,项目名称:angular,代码行数:8,代码来源:segments.ts
示例9:
ListWrapper.forEach(modifierKeys, (modifierName) => {
if (modifierName != key) {
var modifierGetter = StringMapWrapper.get(modifierKeyGetters, modifierName);
if (modifierGetter(event)) {
fullKey += modifierName + '.';
}
}
});
开发者ID:AsherBarak,项目名称:angular,代码行数:8,代码来源:key_events.ts
示例10: _mergeErrors
static _mergeErrors(control: modelModule.AbstractControl, res: StringMap<string, any>): void {
StringMapWrapper.forEach(control.errors, (value, error) => {
if (!StringMapWrapper.contains(res, error)) {
res[error] = [];
}
ListWrapper.push(res[error], control);
});
}
开发者ID:188799958,项目名称:angular,代码行数:8,代码来源:validators.ts
注:本文中的angular2/src/facade/collection.StringMapWrapper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论