@@ -812,9 +841,50 @@ export function main() {
expect(fixture.debugElement.componentInstance.name).toEqual("updatedValue");
})));
- });
+ it("should support
",
+ inject([TestComponentBuilder], fakeAsync((tcb: TestComponentBuilder) => {
+ var t = `
+
+ `;
+
+ var fixture: ComponentFixture;
+ tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((f) => { fixture = f; });
+ tick();
+
+ fixture.debugElement.componentInstance.data = {
+ 'chicken1': new RadioButtonState(false, 'chicken'),
+ 'fish1': new RadioButtonState(true, 'fish'),
+
+ 'chicken2': new RadioButtonState(false, 'chicken'),
+ 'fish2': new RadioButtonState(true, 'fish')
+ };
+ fixture.detectChanges();
+ tick();
+
+ var input = fixture.debugElement.query(By.css("input"));
+ expect(input.nativeElement.checked).toEqual(false);
+
+ dispatchEvent(input.nativeElement, "change");
+ tick();
+
+ let data = fixture.debugElement.componentInstance.data;
+
+ expect(data['chicken1']).toEqual(new RadioButtonState(true, 'chicken'));
+ expect(data['fish1']).toEqual(new RadioButtonState(false, 'fish'));
+
+ expect(data['chicken2']).toEqual(new RadioButtonState(false, 'chicken'));
+ expect(data['fish2']).toEqual(new RadioButtonState(true, 'fish'));
+ })));
+ });
+
describe("setting status classes", () => {
it("should work with single fields",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
diff --git a/modules/angular2/test/public_api_spec.ts b/modules/angular2/test/public_api_spec.ts
index 38c4bdc5ad..9f082bb2b7 100644
--- a/modules/angular2/test/public_api_spec.ts
+++ b/modules/angular2/test/public_api_spec.ts
@@ -51,6 +51,7 @@ var NG_COMMON = [
'AbstractControl.validator',
'AbstractControl.validator=',
'AbstractControl.value',
+ 'AbstractControl.root',
'AbstractControl.valueChanges',
'AbstractControlDirective',
'AbstractControlDirective.control',
@@ -102,6 +103,7 @@ var NG_COMMON = [
'Control.validator',
'Control.validator=',
'Control.value',
+ 'Control.root',
'Control.valueChanges',
'ControlArray',
'ControlArray.asyncValidator',
@@ -134,6 +136,7 @@ var NG_COMMON = [
'ControlArray.validator',
'ControlArray.validator=',
'ControlArray.value',
+ 'ControlArray.root',
'ControlArray.valueChanges',
'ControlContainer',
'ControlContainer.control',
@@ -179,6 +182,7 @@ var NG_COMMON = [
'ControlGroup.validator',
'ControlGroup.validator=',
'ControlGroup.value',
+ 'ControlGroup.root',
'ControlGroup.valueChanges',
'ControlValueAccessor:dart',
'CurrencyPipe',
@@ -447,7 +451,12 @@ var NG_COMMON = [
'Validators#maxLength()',
'Validators#minLength()',
'Validators#nullValidator()',
- 'Validators#required()'
+ 'Validators#required()',
+ 'RadioButtonState',
+ 'RadioButtonState.checked',
+ 'RadioButtonState.checked=',
+ 'RadioButtonState.value',
+ 'RadioButtonState.value='
];
var NG_COMPILER = [
diff --git a/tools/public_api_guard/public_api_spec.ts b/tools/public_api_guard/public_api_spec.ts
index bea8d61740..fbd6a20ac3 100644
--- a/tools/public_api_guard/public_api_spec.ts
+++ b/tools/public_api_guard/public_api_spec.ts
@@ -566,6 +566,7 @@ const COMMON = [
'AbstractControl.updateValueAndValidity({onlySelf,emitEvent}:{onlySelf?:boolean, emitEvent?:boolean}):void',
'AbstractControl.valid:boolean',
'AbstractControl.value:any',
+ 'AbstractControl.root:AbstractControl',
'AbstractControl.valueChanges:Observable',
'AbstractControlDirective',
'AbstractControlDirective.control:AbstractControl',
@@ -794,6 +795,8 @@ const COMMON = [
'Validators.minLength(minLength:number):Function',
'Validators.nullValidator(c:any):{[key:string]:boolean}',
'Validators.required(control:Control):{[key:string]:boolean}',
+ 'RadioButtonState',
+ 'RadioButtonState.constructor(checked:boolean, value:string)',
'const COMMON_DIRECTIVES:Type[][]',
'const COMMON_PIPES:any',
'const CORE_DIRECTIVES:Type[]',