X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules/angular2/angular2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export * from './core';
export * from './profile';
export * from './lifecycle_hooks';
export * from './bootstrap';
export * from './animate';
2 changes: 1 addition & 1 deletion modules/angular2/src/core/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Public API for Application
export {APP_COMPONENT} from './application_tokens';
export {platform, commonBootstrap as bootstrap} from './application_common';
export {PlatformRef, ApplicationRef, rootBindings} from './application_ref';
export {PlatformRef, ApplicationRef} from './application_ref';
2 changes: 1 addition & 1 deletion modules/angular2/src/core/compiler/element_injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
Injector,
ProtoInjector,
Visibility,
UNDEFINED,
Key,
Dependency,
bind,
Expand All @@ -25,6 +24,7 @@ import {
resolveForwardRef,
DependencyProvider
} from 'angular2/src/core/di';
import {UNDEFINED} from 'angular2/src/core/di/injector';
import {
InjectorInlineStrategy,
InjectorDynamicStrategy,
Expand Down
3 changes: 1 addition & 2 deletions modules/angular2/src/core/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export {
ProtoInjector,
BindingWithVisibility,
DependencyProvider,
Visibility,
UNDEFINED
Visibility
} from './di/injector';
export {
Binding,
Expand Down
20 changes: 10 additions & 10 deletions modules/angular2/src/core/directives/ng_for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export class NgFor implements DoCheck {
changes.forEachMovedItem((movedRecord) =>
recordViewTuples.push(new RecordViewTuple(movedRecord, null)));

var insertTuples = NgFor.bulkRemove(recordViewTuples, this._viewContainer);
var insertTuples = this._bulkRemove(recordViewTuples);

changes.forEachAddedItem((addedRecord) =>
insertTuples.push(new RecordViewTuple(addedRecord, null)));

NgFor.bulkInsert(insertTuples, this._viewContainer, this._templateRef);
this._bulkInsert(insertTuples);

for (var i = 0; i < insertTuples.length; i++) {
this._perViewChange(insertTuples[i].view, insertTuples[i].record);
Expand All @@ -92,38 +92,38 @@ export class NgFor implements DoCheck {
view.setLocal('index', record.currentIndex);
}

static bulkRemove(tuples: RecordViewTuple[], viewContainer: ViewContainerRef): RecordViewTuple[] {
private _bulkRemove(tuples: RecordViewTuple[]): RecordViewTuple[] {
tuples.sort((a, b) => a.record.previousIndex - b.record.previousIndex);
var movedTuples = [];
for (var i = tuples.length - 1; i >= 0; i--) {
var tuple = tuples[i];
// separate moved views from removed views.
if (isPresent(tuple.record.currentIndex)) {
tuple.view = viewContainer.detach(tuple.record.previousIndex);
tuple.view = this._viewContainer.detach(tuple.record.previousIndex);
movedTuples.push(tuple);
} else {
viewContainer.remove(tuple.record.previousIndex);
this._viewContainer.remove(tuple.record.previousIndex);
}
}
return movedTuples;
}

static bulkInsert(tuples: RecordViewTuple[], viewContainer: ViewContainerRef,
templateRef: TemplateRef): RecordViewTuple[] {
private _bulkInsert(tuples: RecordViewTuple[]): RecordViewTuple[] {
tuples.sort((a, b) => a.record.currentIndex - b.record.currentIndex);
for (var i = 0; i < tuples.length; i++) {
var tuple = tuples[i];
if (isPresent(tuple.view)) {
viewContainer.insert(tuple.view, tuple.record.currentIndex);
this._viewContainer.insert(tuple.view, tuple.record.currentIndex);
} else {
tuple.view = viewContainer.createEmbeddedView(templateRef, tuple.record.currentIndex);
tuple.view =
this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex);
}
}
return tuples;
}
}

export class RecordViewTuple {
class RecordViewTuple {
view: ViewRef;
record: any;
constructor(record, view) {
Expand Down
1 change: 0 additions & 1 deletion modules/angular2/src/core/render.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Public API for render
export {
RenderDirectiveMetadata,
DomRenderer,
RenderEventDispatcher,
Renderer,
RenderElementRef,
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/router/router_outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptio

import {Directive, Attribute} from 'angular2/src/core/metadata';
import {DynamicComponentLoader, ComponentRef, ElementRef} from 'angular2/src/core/compiler';
import {Injector, bind, Dependency, UNDEFINED} from 'angular2/src/core/di';
import {Injector, bind, Dependency} from 'angular2/src/core/di';

import * as routerMod from './router';
import {ComponentInstruction, RouteParams} from './instruction';
Expand Down
2 changes: 2 additions & 0 deletions modules/angular2/test/public_api_spec.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// ignore in dart
main() {}
Loading
X Tutup