cleanup(di): renamed viewInjector and hostInjector
BREAKING CHANGE
Replace viewInjector with viewBindings
Replace hostInjector with bindings
This commit is contained in:
@@ -50,7 +50,7 @@ const controlGroupBinding =
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ng-control-group]',
|
||||
hostInjector: [controlGroupBinding],
|
||||
bindings: [controlGroupBinding],
|
||||
properties: ['name: ng-control-group'],
|
||||
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy],
|
||||
exportAs: 'form'
|
||||
|
||||
@@ -73,7 +73,7 @@ const controlNameBinding =
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ng-control]',
|
||||
hostInjector: [controlNameBinding],
|
||||
bindings: [controlNameBinding],
|
||||
properties: ['name: ngControl', 'model: ngModel'],
|
||||
events: ['update: ngModel'],
|
||||
lifecycle: [LifecycleEvent.onDestroy, LifecycleEvent.onChange],
|
||||
|
||||
@@ -52,7 +52,7 @@ const formDirectiveBinding =
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'form:not([ng-no-form]):not([ng-form-model]),ng-form,[ng-form]',
|
||||
hostInjector: [formDirectiveBinding],
|
||||
bindings: [formDirectiveBinding],
|
||||
host: {
|
||||
'(submit)': 'onSubmit()',
|
||||
},
|
||||
|
||||
@@ -60,7 +60,7 @@ const formControlBinding =
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ng-form-control]',
|
||||
hostInjector: [formControlBinding],
|
||||
bindings: [formControlBinding],
|
||||
properties: ['form: ngFormControl', 'model: ngModel'],
|
||||
events: ['update: ngModel'],
|
||||
lifecycle: [LifecycleEvent.onChange],
|
||||
|
||||
@@ -82,7 +82,7 @@ const formDirectiveBinding =
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ng-form-model]',
|
||||
hostInjector: [formDirectiveBinding],
|
||||
bindings: [formDirectiveBinding],
|
||||
properties: ['form: ng-form-model'],
|
||||
lifecycle: [LifecycleEvent.onChange],
|
||||
host: {
|
||||
|
||||
@@ -30,7 +30,7 @@ const formControlBinding = CONST_EXPR(new Binding(NgControl, {toAlias: forwardRe
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[ng-model]:not([ng-control]):not([ng-form-control])',
|
||||
hostInjector: [formControlBinding],
|
||||
bindings: [formControlBinding],
|
||||
properties: ['model: ngModel'],
|
||||
events: ['update: ngModel'],
|
||||
lifecycle: [LifecycleEvent.onChange],
|
||||
|
||||
@@ -12,7 +12,7 @@ const requiredValidatorBinding =
|
||||
|
||||
@Directive({
|
||||
selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]',
|
||||
hostInjector: [requiredValidatorBinding]
|
||||
bindings: [requiredValidatorBinding]
|
||||
})
|
||||
export class NgRequiredValidator extends NgValidator {
|
||||
get validator(): Function { return Validators.required; }
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as modelModule from './model';
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'login-comp',
|
||||
* viewInjector: [
|
||||
* viewBindings: [
|
||||
* FormBuilder
|
||||
* ]
|
||||
* })
|
||||
|
||||
Reference in New Issue
Block a user