Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

bindToController and $onInit #9259

Closed
Closed
@prasannapattam

Description

@prasannapattam

Actual Behavior:

  • What is the issue? *
    I am using $mdDialog bindToController option with TypeScript classes transcompiled to es6. My locals are not getting bound to the controller. With es5 option, the locals are getting bound to the controller.
    Looking at the AngularJS documentation, they are depreciating binding to the controller before a constructor is being called (even for es5). As per the attached AngularJS discussion, this will be depreciated by AngularJS 1.6 (not a default option). So this will soon become a bug.
    Properties set before constructor is called when using bindToController angular.js#14206
    I am using $onInit function to initialize the controller bound values. This $onInit function is not getting called.
  • What is the expected behavior?
    $onInit function should be called when bindToController is set to true

CodePen (or steps to reproduce the issue): *

  • CodePen Demo which shows your issue:
  • Details:

Angular Versions: *

  • Angular Version: 1.5.8
  • Angular Material Version: v1.1.0-rc.5

Additional Information:

  • Browser Type: * Chrome
  • Browser Version: * 51.0.2704.103 m
  • OS: * Windows 10
  • Stack Traces:

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

Metadata

Metadata

Labels

P2: requiredIssues that must be fixed.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions