本文整理匯總了TypeScript中@angular/facade/src/collection.ListWrapper.clone方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ListWrapper.clone方法的具體用法?TypeScript ListWrapper.clone怎麽用?TypeScript ListWrapper.clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/facade/src/collection.ListWrapper
的用法示例。
在下文中一共展示了ListWrapper.clone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _update
function _update(node: TreeNode<UrlSegment>, changes: any[]): TreeNode<UrlSegment> {
let rest = changes.slice(1);
let outlet = _outlet(changes);
let segment = _segment(changes);
if (isString(segment) && segment[0] == "/") segment = segment.substring(1);
// reach the end of the tree => create new tree nodes.
if (isBlank(node)) {
let urlSegment = new UrlSegment(segment, null, outlet);
let children = rest.length === 0 ? [] : [_update(null, rest)];
return new TreeNode<UrlSegment>(urlSegment, children);
// different outlet => preserve the subtree
} else if (outlet != node.value.outlet) {
return node;
// same outlet => modify the subtree
} else {
let urlSegment = isStringMap(segment) ? new UrlSegment(null, segment, null) :
new UrlSegment(segment, null, outlet);
if (rest.length === 0) {
return new TreeNode<UrlSegment>(urlSegment, []);
}
return new TreeNode<UrlSegment>(urlSegment,
_updateMany(ListWrapper.clone(node.children), rest));
}
}
示例2: _computeStageButtons
_computeStageButtons() {
var disabled = true;
this.stages = ListWrapper.clone(STATUS_LIST.map((status) => {
var isCurrent = this._offering.status == status;
var stage = new Stage();
stage.name = status;
stage.isDisabled = disabled;
stage.backgroundColor = disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD';
if (isCurrent) {
disabled = false;
}
return stage;
}));
}