refactor: remove most facades (#12399)
This commit is contained in:

committed by
Igor Minar

parent
e319cfefc3
commit
57051f01ce
@ -1,6 +1,5 @@
|
||||
import {PromiseWrapper} from '@angular/facade/src/async';
|
||||
import {ListWrapper, Map, MapWrapper} from '@angular/facade/src/collection';
|
||||
import {Type, isPresent, print} from '@angular/facade/src/lang';
|
||||
import {Type, print} from '@angular/facade/src/lang';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {BrowserDomAdapter} from '@angular/platform-browser/src/browser/browser_adapter';
|
||||
import {DOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
@ -68,7 +67,7 @@ class MultiplyDirectiveResolver extends DirectiveResolver {
|
||||
|
||||
_fillCache(component: Type) {
|
||||
var view = super.resolve(component);
|
||||
var multipliedTemplates = ListWrapper.createFixedSize(this._multiplyBy);
|
||||
var multipliedTemplates = new Array(this._multiplyBy);
|
||||
for (var i = 0; i < this._multiplyBy; ++i) {
|
||||
multipliedTemplates[i] = view.template;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ var testList = null;
|
||||
|
||||
export function main() {
|
||||
var size = getIntParameter('size');
|
||||
testList = ListWrapper.createFixedSize(size);
|
||||
testList = new Array(size);
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule).then((ref) => {
|
||||
var injector = ref.injector;
|
||||
|
@ -1,6 +1,5 @@
|
||||
import {NgFor} from '@angular/common';
|
||||
import {Component, Directive} from '@angular/core';
|
||||
import {ListWrapper, Map} from '@angular/facade/src/collection';
|
||||
|
||||
import {Account, Company, CustomDate, Offering, Opportunity, STATUS_LIST} from './common';
|
||||
|
||||
@ -81,17 +80,19 @@ export class StageButtonsComponent extends HasStyle {
|
||||
|
||||
_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;
|
||||
}));
|
||||
this.stages = STATUS_LIST
|
||||
.map((status) => {
|
||||
const isCurrent = this._offering.status == status;
|
||||
const stage = new Stage();
|
||||
stage.name = status;
|
||||
stage.isDisabled = disabled;
|
||||
stage.backgroundColor = disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD';
|
||||
if (isCurrent) {
|
||||
disabled = false;
|
||||
}
|
||||
return stage;
|
||||
})
|
||||
.slice();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import {ListWrapper, Map, MapWrapper} from '@angular/facade/src/collection';
|
||||
import {Math} from '@angular/facade/src/math';
|
||||
|
||||
export var ITEMS = 1000;
|
||||
@ -62,7 +61,7 @@ export class RawEntity {
|
||||
return this._data[key];
|
||||
}
|
||||
var pieces = key.split('.');
|
||||
var last = ListWrapper.last(pieces);
|
||||
var last = pieces[pieces.length - 1];
|
||||
pieces.length = pieces.length - 1;
|
||||
var target = this._resolve(pieces, this);
|
||||
if (target == null) {
|
||||
@ -77,7 +76,7 @@ export class RawEntity {
|
||||
return;
|
||||
}
|
||||
var pieces = key.split('.');
|
||||
var last = ListWrapper.last(pieces);
|
||||
var last = pieces[pieces.length - 1];
|
||||
pieces.length = pieces.length - 1;
|
||||
var target = this._resolve(pieces, this);
|
||||
target[last] = value;
|
||||
@ -88,7 +87,7 @@ export class RawEntity {
|
||||
return this._data.delete(key);
|
||||
}
|
||||
var pieces = key.split('.');
|
||||
var last = ListWrapper.last(pieces);
|
||||
var last = pieces[pieces.length - 1];
|
||||
pieces.length = pieces.length - 1;
|
||||
var target = this._resolve(pieces, this);
|
||||
return target.remove(last);
|
||||
|
@ -1,7 +1,5 @@
|
||||
import {NgFor} from '@angular/common';
|
||||
import {Component, Directive} from '@angular/core';
|
||||
import {ListWrapper} from '@angular/facade/src/collection';
|
||||
import {Math} from '@angular/facade/src/math';
|
||||
|
||||
import {HEIGHT, ITEMS, ITEM_HEIGHT, Offering, ROW_WIDTH, VIEW_PORT_HEIGHT, VISIBLE_ITEMS} from './common';
|
||||
import {generateOfferings} from './random_data';
|
||||
@ -63,6 +61,6 @@ export class ScrollAreaComponent {
|
||||
if (this.paddingDiv != null) {
|
||||
this.paddingDiv.style.setProperty('height', `${padding}px`);
|
||||
}
|
||||
this.visibleItems = ListWrapper.slice(this._fullList, iStart, iEnd);
|
||||
this.visibleItems = this._fullList.slice(iStart, iEnd);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user