From c4ecbf0a7f3dbff81a09cad4504f95957ba18973 Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Thu, 11 Jun 2015 18:49:07 -0700 Subject: [PATCH] fix: rename FORWARD_REF to forwardRef in the Angular code base. Now that ts2dart understands forwardRef, there's no need to maintain the old syntax. --- modules/angular2/src/di/forward_ref.ts | 2 -- modules/angular2/src/forms/directives/ng_control_group.ts | 4 ++-- modules/angular2/src/forms/directives/ng_control_name.ts | 4 ++-- modules/angular2/src/forms/directives/ng_form.ts | 4 ++-- modules/angular2/src/forms/directives/ng_form_control.ts | 4 ++-- modules/angular2/src/forms/directives/ng_form_model.ts | 4 ++-- modules/angular2/src/forms/directives/ng_model.ts | 4 ++-- modules/angular2/test/core/compiler/integration_spec.ts | 6 +++--- modules/angular2_material/src/components/dialog/dialog.ts | 4 ++-- 9 files changed, 17 insertions(+), 19 deletions(-) diff --git a/modules/angular2/src/di/forward_ref.ts b/modules/angular2/src/di/forward_ref.ts index b94faa1c91..a80d4c1652 100644 --- a/modules/angular2/src/di/forward_ref.ts +++ b/modules/angular2/src/di/forward_ref.ts @@ -34,8 +34,6 @@ export function forwardRef(forwardRefFn: ForwardRefFn): Type { return (forwardRefFn); } -export var FORWARD_REF = forwardRef; - /** * Lazily retrieve the reference value. * diff --git a/modules/angular2/src/forms/directives/ng_control_group.ts b/modules/angular2/src/forms/directives/ng_control_group.ts index d67fcbc33d..23c3683b19 100644 --- a/modules/angular2/src/forms/directives/ng_control_group.ts +++ b/modules/angular2/src/forms/directives/ng_control_group.ts @@ -1,5 +1,5 @@ import {Directive, Ancestor, onDestroy, onInit} from 'angular2/angular2'; -import {Inject, FORWARD_REF, Binding} from 'angular2/di'; +import {Inject, forwardRef, Binding} from 'angular2/di'; import {List, ListWrapper} from 'angular2/src/facade/collection'; import {CONST_EXPR} from 'angular2/src/facade/lang'; @@ -7,7 +7,7 @@ import {ControlContainer} from './control_container'; import {controlPath} from './shared'; const controlGroupBinding = - CONST_EXPR(new Binding(ControlContainer, {toAlias: FORWARD_REF(() => NgControlGroup)})); + CONST_EXPR(new Binding(ControlContainer, {toAlias: forwardRef(() => NgControlGroup)})); /** * Creates and binds a control group to a DOM element. diff --git a/modules/angular2/src/forms/directives/ng_control_name.ts b/modules/angular2/src/forms/directives/ng_control_name.ts index c0a5188f71..19c384a110 100644 --- a/modules/angular2/src/forms/directives/ng_control_name.ts +++ b/modules/angular2/src/forms/directives/ng_control_name.ts @@ -2,7 +2,7 @@ import {CONST_EXPR} from 'angular2/src/facade/lang'; import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async'; import {List, StringMapWrapper, StringMap} from 'angular2/src/facade/collection'; import {Directive, Ancestor, onDestroy, onChange} from 'angular2/angular2'; -import {FORWARD_REF, Binding, Inject} from 'angular2/di'; +import {forwardRef, Binding, Inject} from 'angular2/di'; import {ControlContainer} from './control_container'; import {NgControl} from './ng_control'; @@ -10,7 +10,7 @@ import {controlPath} from './shared'; import {Control} from '../model'; const controlNameBinding = - CONST_EXPR(new Binding(NgControl, {toAlias: FORWARD_REF(() => NgControlName)})); + CONST_EXPR(new Binding(NgControl, {toAlias: forwardRef(() => NgControlName)})); /** * Creates and binds a control with a specified name to a DOM element. diff --git a/modules/angular2/src/forms/directives/ng_form.ts b/modules/angular2/src/forms/directives/ng_form.ts index 421e315fcf..1eb3dd7497 100644 --- a/modules/angular2/src/forms/directives/ng_form.ts +++ b/modules/angular2/src/forms/directives/ng_form.ts @@ -2,7 +2,7 @@ import {PromiseWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/faca import {StringMapWrapper, List, ListWrapper} from 'angular2/src/facade/collection'; import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/facade/lang'; import {Directive} from 'angular2/src/core/annotations/decorators'; -import {FORWARD_REF, Binding} from 'angular2/di'; +import {forwardRef, Binding} from 'angular2/di'; import {NgControl} from './ng_control'; import {Form} from './form_interface'; import {NgControlGroup} from './ng_control_group'; @@ -11,7 +11,7 @@ import {AbstractControl, ControlGroup, Control} from '../model'; import {setUpControl} from './shared'; const formDirectiveBinding = - CONST_EXPR(new Binding(ControlContainer, {toAlias: FORWARD_REF(() => NgForm)})); + CONST_EXPR(new Binding(ControlContainer, {toAlias: forwardRef(() => NgForm)})); /** * Creates and binds a form object to a DOM element. diff --git a/modules/angular2/src/forms/directives/ng_form_control.ts b/modules/angular2/src/forms/directives/ng_form_control.ts index edd458b5a5..a80749fbf7 100644 --- a/modules/angular2/src/forms/directives/ng_form_control.ts +++ b/modules/angular2/src/forms/directives/ng_form_control.ts @@ -3,14 +3,14 @@ import {StringMapWrapper} from 'angular2/src/facade/collection'; import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async'; import {Directive, Ancestor, onChange} from 'angular2/angular2'; -import {FORWARD_REF, Binding} from 'angular2/di'; +import {forwardRef, Binding} from 'angular2/di'; import {NgControl} from './ng_control'; import {Control} from '../model'; import {setUpControl} from './shared'; const formControlBinding = - CONST_EXPR(new Binding(NgControl, {toAlias: FORWARD_REF(() => NgFormControl)})); + CONST_EXPR(new Binding(NgControl, {toAlias: forwardRef(() => NgFormControl)})); /** * Binds an existing control to a DOM element. diff --git a/modules/angular2/src/forms/directives/ng_form_model.ts b/modules/angular2/src/forms/directives/ng_form_model.ts index 3c6a2e508a..fdfa64ce44 100644 --- a/modules/angular2/src/forms/directives/ng_form_model.ts +++ b/modules/angular2/src/forms/directives/ng_form_model.ts @@ -3,7 +3,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection'; import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async'; import {Directive, onChange} from 'angular2/angular2'; -import {FORWARD_REF, Binding} from 'angular2/di'; +import {forwardRef, Binding} from 'angular2/di'; import {NgControl} from './ng_control'; import {NgControlGroup} from './ng_control_group'; import {ControlContainer} from './control_container'; @@ -12,7 +12,7 @@ import {Control, ControlGroup} from '../model'; import {setUpControl} from './shared'; const formDirectiveBinding = - CONST_EXPR(new Binding(ControlContainer, {toAlias: FORWARD_REF(() => NgFormModel)})); + CONST_EXPR(new Binding(ControlContainer, {toAlias: forwardRef(() => NgFormModel)})); /** * Binds an existing control group to a DOM element. diff --git a/modules/angular2/src/forms/directives/ng_model.ts b/modules/angular2/src/forms/directives/ng_model.ts index d52741833d..a769a798c3 100644 --- a/modules/angular2/src/forms/directives/ng_model.ts +++ b/modules/angular2/src/forms/directives/ng_model.ts @@ -3,14 +3,14 @@ import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async'; import {StringMapWrapper} from 'angular2/src/facade/collection'; import {Directive, Ancestor, onChange} from 'angular2/angular2'; -import {FORWARD_REF, Binding} from 'angular2/di'; +import {forwardRef, Binding} from 'angular2/di'; import {NgControl} from './ng_control'; import {Control} from '../model'; import {setUpControl} from './shared'; const formControlBinding = - CONST_EXPR(new Binding(NgControl, {toAlias: FORWARD_REF(() => NgModel)})); + CONST_EXPR(new Binding(NgControl, {toAlias: forwardRef(() => NgModel)})); /** * Binds a domain model to the form. diff --git a/modules/angular2/test/core/compiler/integration_spec.ts b/modules/angular2/test/core/compiler/integration_spec.ts index 2740702c56..8b43b1b3bc 100644 --- a/modules/angular2/test/core/compiler/integration_spec.ts +++ b/modules/angular2/test/core/compiler/integration_spec.ts @@ -34,7 +34,7 @@ import { } from 'angular2/src/facade/lang'; import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async'; -import {Injector, bind, Injectable, Binding, FORWARD_REF, OpaqueToken, Inject} from 'angular2/di'; +import {Injector, bind, Injectable, Binding, forwardRef, OpaqueToken, Inject} from 'angular2/di'; import { PipeRegistry, defaultPipeRegistry, @@ -1692,11 +1692,11 @@ function createParentBusView(p) { viewInjector: [ new Binding( EventBus, - {toFactory: createParentBusView, deps: [[FORWARD_REF(() => ParentProvidingEventBus)]]}) + {toFactory: createParentBusView, deps: [[forwardRef(() => ParentProvidingEventBus)]]}) ] }) @View({ - directives: [FORWARD_REF(() => ChildConsumingEventBus)], + directives: [forwardRef(() => ChildConsumingEventBus)], template: ` ` diff --git a/modules/angular2_material/src/components/dialog/dialog.ts b/modules/angular2_material/src/components/dialog/dialog.ts index d014f09c99..5a4d577da5 100644 --- a/modules/angular2_material/src/components/dialog/dialog.ts +++ b/modules/angular2_material/src/components/dialog/dialog.ts @@ -8,7 +8,7 @@ import { ComponentRef, DomRenderer } from 'angular2/angular2'; -import {bind, Injector, Injectable, FORWARD_REF} from 'angular2/di'; +import {bind, Injector, Injectable, forwardRef} from 'angular2/di'; import {ObservableWrapper, Promise, PromiseWrapper} from 'angular2/src/facade/async'; import {isPresent, Type} from 'angular2/src/facade/lang'; @@ -213,7 +213,7 @@ export class MdDialogConfig { }) @View({ templateUrl: 'angular2_material/src/components/dialog/dialog.html', - directives: [FORWARD_REF(() => MdDialogContent)] + directives: [forwardRef(() => MdDialogContent)] }) class MdDialogContainer { // Ref to the dialog content. Used by the DynamicComponentLoader to load the dialog content.