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
Description
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.8Angular Material Version:
v1.1.0-rc.5
Additional Information:
Browser Type: *
ChromeBrowser Version: *
51.0.2704.103 mOS: *
Windows 10Stack 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.