fix(benchmark): change If for NgIf
This commit is contained in:
@ -8,7 +8,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
|
|||||||
import {reflector} from 'angular2/src/reflection/reflection';
|
import {reflector} from 'angular2/src/reflection/reflection';
|
||||||
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
|
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
|
||||||
import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
||||||
import {If, NgFor} from 'angular2/directives';
|
import {NgIf, NgFor} from 'angular2/directives';
|
||||||
|
|
||||||
// TODO(radokirov): Once the application is transpiled by TS instead of Traceur,
|
// TODO(radokirov): Once the application is transpiled by TS instead of Traceur,
|
||||||
// add those imports back into 'angular2/angular2';
|
// add those imports back into 'angular2/angular2';
|
||||||
@ -54,7 +54,7 @@ export function main() {
|
|||||||
|
|
||||||
@Component({selector: 'app'})
|
@Component({selector: 'app'})
|
||||||
@View({
|
@View({
|
||||||
directives: [If, NgFor, DummyComponent, DummyDirective, DynamicDummy],
|
directives: [NgIf, NgFor, DummyComponent, DummyDirective, DynamicDummy],
|
||||||
template: `
|
template: `
|
||||||
<div *ng-if="testingPlainComponents">
|
<div *ng-if="testingPlainComponents">
|
||||||
<dummy *ng-for="#i of list"></dummy>
|
<dummy *ng-for="#i of list"></dummy>
|
||||||
|
@ -13,7 +13,7 @@ import {isPresent} from 'angular2/src/facade/lang';
|
|||||||
import {List} from 'angular2/src/facade/collection';
|
import {List} from 'angular2/src/facade/collection';
|
||||||
import {window, document, gc} from 'angular2/src/facade/browser';
|
import {window, document, gc} from 'angular2/src/facade/browser';
|
||||||
import {getIntParameter, getStringParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
import {getIntParameter, getStringParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
|
||||||
import {If} from 'angular2/directives';
|
import {NgIf} from 'angular2/directives';
|
||||||
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
||||||
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
||||||
import {bind} from 'angular2/di';
|
import {bind} from 'angular2/di';
|
||||||
@ -245,8 +245,8 @@ class AppComponent {
|
|||||||
properties: {'data': 'data'}
|
properties: {'data': 'data'}
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
directives: [TreeComponent, If],
|
directives: [TreeComponent, NgIf],
|
||||||
template: `<span> {{data.value}} <span template='if data.right != null'><tree [data]='data.right'></tree></span><span template='if data.left != null'><tree [data]='data.left'></tree></span></span>`
|
template: `<span> {{data.value}} <span template='ng-if data.right != null'><tree [data]='data.right'></tree></span><span template='ng-if data.left != null'><tree [data]='data.left'></tree></span></span>`
|
||||||
})
|
})
|
||||||
class TreeComponent {
|
class TreeComponent {
|
||||||
data:TreeNode;
|
data:TreeNode;
|
||||||
|
Reference in New Issue
Block a user