From 1bbb27fd62baf94293d625de9052b7a5270eff3e Mon Sep 17 00:00:00 2001 From: Ji Won Shin Date: Tue, 22 Aug 2017 18:23:24 -0700 Subject: [PATCH] Changes to address aot compiler failures --- src/demo-app/stepper/stepper-demo.html | 4 ++-- src/lib/stepper/step-label.ts | 5 ++++- src/lib/stepper/stepper-button.ts | 8 ++++++-- src/lib/stepper/stepper.ts | 8 ++++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/demo-app/stepper/stepper-demo.html b/src/demo-app/stepper/stepper-demo.html index d7636d14e9bb..11cda6eaea19 100644 --- a/src/demo-app/stepper/stepper-demo.html +++ b/src/demo-app/stepper/stepper-demo.html @@ -3,7 +3,7 @@

Linear Vertical Stepper Demo using a single form

- + Fill out your name @@ -19,7 +19,7 @@

Linear Vertical Stepper Demo using a single form

- +
Fill out your email address
diff --git a/src/lib/stepper/step-label.ts b/src/lib/stepper/step-label.ts index 0fe652f20b87..62e1bc7f60e4 100644 --- a/src/lib/stepper/step-label.ts +++ b/src/lib/stepper/step-label.ts @@ -9,10 +9,13 @@ import {Directive, TemplateRef} from '@angular/core'; import {CdkStepLabel} from '@angular/cdk/stepper'; +/** Workaround for https://github.com/angular/angular/issues/17849 */ +export const _MdStepLabel = CdkStepLabel; + @Directive({ selector: '[mdStepLabel], [matStepLabel]', }) -export class MdStepLabel extends CdkStepLabel { +export class MdStepLabel extends _MdStepLabel { constructor(template: TemplateRef) { super(template); } diff --git a/src/lib/stepper/stepper-button.ts b/src/lib/stepper/stepper-button.ts index 7dee99256c29..e1d5bb488bef 100644 --- a/src/lib/stepper/stepper-button.ts +++ b/src/lib/stepper/stepper-button.ts @@ -10,13 +10,17 @@ import {Directive} from '@angular/core'; import {CdkStepper, CdkStepperNext, CdkStepperPrevious} from '@angular/cdk/stepper'; import {MdStepper} from './stepper'; +/** Workaround for https://github.com/angular/angular/issues/17849 */ +export const _MdStepperNext = CdkStepperNext; +export const _MdStepperPrevious = CdkStepperPrevious; + /** Button that moves to the next step in a stepper workflow. */ @Directive({ selector: 'button[mdStepperNext], button[matStepperNext]', host: {'(click)': '_stepper.next()'}, providers: [{provide: CdkStepper, useExisting: MdStepper}] }) -export class MdStepperNext extends CdkStepperNext { } +export class MdStepperNext extends _MdStepperNext { } /** Button that moves to the previous step in a stepper workflow. */ @Directive({ @@ -24,4 +28,4 @@ export class MdStepperNext extends CdkStepperNext { } host: {'(click)': '_stepper.previous()'}, providers: [{provide: CdkStepper, useExisting: MdStepper}] }) -export class MdStepperPrevious extends CdkStepperPrevious { } +export class MdStepperPrevious extends _MdStepperPrevious { } diff --git a/src/lib/stepper/stepper.ts b/src/lib/stepper/stepper.ts index 37e35ef40c70..80efc8dc34e4 100644 --- a/src/lib/stepper/stepper.ts +++ b/src/lib/stepper/stepper.ts @@ -32,6 +32,10 @@ import { import {FormControl, FormGroupDirective, NgForm} from '@angular/forms'; import {MdStepHeader} from './step-header'; +/** Workaround for https://github.com/angular/angular/issues/17849 */ +export const _MdStep = CdkStep; +export const _MdStepper = CdkStepper; + @Component({ moduleId: module.id, selector: 'md-step, mat-step', @@ -39,7 +43,7 @@ import {MdStepHeader} from './step-header'; providers: [{provide: MD_ERROR_GLOBAL_OPTIONS, useExisting: MdStep}], encapsulation: ViewEncapsulation.None }) -export class MdStep extends CdkStep implements ErrorOptions { +export class MdStep extends _MdStep implements ErrorOptions { /** Content for step label given by or . */ @ContentChild(MdStepLabel) stepLabel: MdStepLabel; @@ -70,7 +74,7 @@ export class MdStep extends CdkStep implements ErrorOptions { @Directive({ selector: '[mdStepper]' }) -export class MdStepper extends CdkStepper implements ErrorOptions { +export class MdStepper extends _MdStepper implements ErrorOptions { /** The list of step headers of the steps in the stepper. */ @ViewChildren(MdStepHeader, {read: ElementRef}) _stepHeader: QueryList;