Skip to content

[sidenav @alpha.8-1] Binding to [opened] causes Angular AoT compiler error #1200

@RoxKilly

Description

@RoxKilly

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The docs for sidenav list opened as a public facing property. I expect to be able to bind to it and use Angular's Ahead-of-Time compiler (ngc)

What is the current behavior?

template

<md-sidenav-layout class="sidenav-layout">
    <md-sidenav mode="over" [opened]="isNavOpen">
        ...
    </md-sidenav>
    ...
</md-sidenav-layout>

component

public isNavOpen:boolean = false;

Trying to bind to [opened] this way causes ngc to throw the following error:

 Error: (filename:line number): Property '_opened' is private and only accessible within class 'MdSidenav'.

Triggered by the block below (line 795):

793|  const currVal_27:any = this.context.isNavOpen;
794|  if (import5.checkBinding(throwOnChange,this._expr_27,currVal_27)) {
795|     this._MdSidenav_51_4._opened = currVal_27;
796|     changed = true;
797|     this._expr_27 = currVal_27;
798|   }

Using in-browser compilation works fine. In that scenario, no error is raised during vanilla typescript transpilation

What are the steps to reproduce?

Use the template above, and try AoT compilation

Which versions of Angular, Material, OS, browsers are affected?

Angular 2 rc.6, Material 2 alpha 8-1, compiled using node 4.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions