diff --git a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts index 9c18b62667..369311d07c 100644 --- a/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts +++ b/modules/@angular/compiler/src/schema/dom_element_schema_registry.ts @@ -231,6 +231,7 @@ const SCHEMA: const _ATTR_TO_PROP: {[name: string]: string} = { 'class': 'className', + 'for': 'htmlFor', 'formaction': 'formAction', 'innerHtml': 'innerHTML', 'readonly': 'readOnly', diff --git a/modules/@angular/core/test/linker/integration_spec.ts b/modules/@angular/core/test/linker/integration_spec.ts index 6d0e07fa5e..ed15a3bdb6 100644 --- a/modules/@angular/core/test/linker/integration_spec.ts +++ b/modules/@angular/core/test/linker/integration_spec.ts @@ -217,6 +217,19 @@ function declareTests({useJit}: {useJit: boolean}) { expect(nativeEl).not.toHaveCssClass('initial'); }); + it('should consume binding to htmlFor using for alias', () => { + const template = ''; + const fixture = TestBed.configureTestingModule({declarations: [MyComp]}) + .overrideComponent(MyComp, {set: {template}}) + .createComponent(MyComp); + + const nativeEl = fixture.debugElement.children[0].nativeElement; + fixture.debugElement.componentInstance.ctxProp = 'foo'; + fixture.detectChanges(); + + expect(nativeEl.htmlFor).toBe('foo'); + }); + it('should consume directive watch expression change.', () => { TestBed.configureTestingModule({declarations: [MyComp, MyDir]}); const template = '' +