From f21e78244f5c282b924b5290b5d7261ab69a4a55 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Mon, 2 Nov 2015 11:37:04 -0800 Subject: [PATCH] feat(forms): Use the DefaultValueAccessor for controls with an ng-default-control attribute. Third party controls require a ControlValueAccessor to function with Angular Forms. Many of them, like Polymer's , behave like the native element and thus can use the DefaultValueAccessor. Adding an ng-default-control attribute will now allow them to use that directive. Closes #5076 --- .../src/core/forms/directives/default_value_accessor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/angular2/src/core/forms/directives/default_value_accessor.ts b/modules/angular2/src/core/forms/directives/default_value_accessor.ts index fa23a0870e..3d5c86f97e 100644 --- a/modules/angular2/src/core/forms/directives/default_value_accessor.ts +++ b/modules/angular2/src/core/forms/directives/default_value_accessor.ts @@ -20,7 +20,7 @@ const DEFAULT_VALUE_ACCESSOR = CONST_EXPR(new Provider( */ @Directive({ selector: - 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model]', + 'input:not([type=checkbox])[ng-control],textarea[ng-control],input:not([type=checkbox])[ng-form-control],textarea[ng-form-control],input:not([type=checkbox])[ng-model],textarea[ng-model],[ng-default-control]', // TODO: vsavkin replace the above selector with the one below it once // https://github.com/angular/angular/issues/3011 is implemented // selector: '[ng-control],[ng-model],[ng-form-control]',