本文整理汇总了TypeScript中angular2/src/facade/collection.ListWrapper.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ListWrapper.create方法的具体用法?TypeScript ListWrapper.create怎么用?TypeScript ListWrapper.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.ListWrapper
的用法示例。
在下文中一共展示了ListWrapper.create方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _emptyAllActiveViewContainers
_emptyAllActiveViewContainers() {
var activeContainers = this._activeViewContainers;
for (var i = 0; i < activeContainers.length; i++) {
activeContainers[i].remove();
}
this._activeViewContainers = ListWrapper.create();
}
示例2: recognize
/**
* Given a URL, returns a list of `RouteMatch`es, which are partial recognitions for some route.
*
*/
recognize(url: string): List<RouteMatch> {
var solutions = ListWrapper.create();
MapWrapper.forEach(this.redirects, (target, path) => {
// TODO: "/" redirect case
if (StringWrapper.startsWith(url, path)) {
url = target + StringWrapper.substring(url, path.length);
}
});
MapWrapper.forEach(this.matchers, (pathRecognizer, regex) => {
var match;
if (isPresent(match = RegExpWrapper.firstMatch(regex, url))) {
// TODO(btford): determine a good generic way to deal with terminal matches
var matchedUrl = '/';
var unmatchedUrl = '';
if (url != '/') {
matchedUrl = match[0];
unmatchedUrl = StringWrapper.substring(url, match[0].length);
}
ListWrapper.push(solutions, new RouteMatch({
specificity: pathRecognizer.specificity,
handler: pathRecognizer.handler,
params: pathRecognizer.parseParams(url),
matchedUrl: matchedUrl,
unmatchedUrl: unmatchedUrl
}));
}
});
return solutions;
}
示例3: toString
toString(): string {
var paramsList = ListWrapper.create();
MapWrapper.forEach(this.paramsMap, (values, k) => {
ListWrapper.forEach(values, v => { ListWrapper.push(paramsList, k + '=' + v); });
});
return ListWrapper.join(paramsList, '&');
}
示例4: constructor
constructor() {
super();
this._path = '/';
this.urlChanges = ListWrapper.create();
this._subject = new EventEmitter();
this._baseHref = '';
}
示例5:
ListWrapper.forEach(params, (param: string) => {
var split: List<string> = StringWrapper.split(param, '=');
var key = ListWrapper.get(split, 0);
var val = ListWrapper.get(split, 1);
var list = MapWrapper.get(map, key) || ListWrapper.create();
ListWrapper.push(list, val);
MapWrapper.set(map, key, list);
});
示例6: light
static light(debugElement): List<DebugElement> {
var scope = ListWrapper.create();
ListWrapper.forEach(debugElement.children, (child) => {
ListWrapper.push(scope, child);
scope = ListWrapper.concat(scope, Scope.light(child));
});
return scope;
}
示例7: _registerViewContainer
_registerViewContainer(value, container) {
var containers = MapWrapper.get(this._valueViewContainers, value);
if (isBlank(containers)) {
containers = ListWrapper.create();
MapWrapper.set(this._valueViewContainers, value, containers);
}
ListWrapper.push(containers, container);
}
示例8: _addTerminal
_addTerminal(map, name, selectable) {
var terminalList = MapWrapper.get(map, name);
if (isBlank(terminalList)) {
terminalList = ListWrapper.create();
MapWrapper.set(map, name, terminalList);
}
ListWrapper.push(terminalList, selectable);
}
示例9: process
process(rootElement, compilationCtxtDescription = '') {
var results = ListWrapper.create();
var rootCompileElement = new CompileElement(rootElement, compilationCtxtDescription);
rootCompileElement.inheritedProtoView = new ProtoViewBuilder(rootElement);
rootCompileElement.isViewRoot = true;
this._process(results, null, rootCompileElement, compilationCtxtDescription);
return results;
}
示例10: view
static view(testElement): List<TestElement> {
var scope = ListWrapper.create();
ListWrapper.forEach(testElement.componentViewChildren, (child) => {
ListWrapper.push(scope, child);
scope = ListWrapper.concat(scope, Scope.light(child));
});
return scope;
}