You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Is there anything else we should know? Stack Traces, Screenshots, etc.
Playing with the angular-material js file, I found that changing the line 2644 from the compiled js file, inside the MdCompilerService.prototype._createController function, from: angular.extend(invokeCtrl.instance, locals); to angular.extend(ctrl, locals); made it worked.
I also had to add the $mdCompilerProvider.respectPreAssignBindingsEnabled(true); so that line gets executed, because the line angular.extend(invokeCtrl.instance, locals); doesn't bind anything
The text was updated successfully, but these errors were encountered:
Thank you for your contribution and for looking for a solution for this! However, it is already fixed in master (#10977) and should be out in the 1.1.6 release soon.
Bug:
After changing typescript target to es6,
locals
bindings withbindToController = true
stopped working, for example with $mdDialog.show(...)I updated to latest v1.1.5, and the problem remains.
What is the expected behavior?
It should bind the locals to the controller directly without passing them to the constructor
After initialization
$ctrl.data
should be thereWhat is the current behavior?
It doesn't bind the locals to the controller when using classes, so
$ctrl.data
is undefinedCodePen and steps to reproduce the issue:
CodePen Demo which shows your issue:
https://codepen.io/mribichich/pen/OzZRYo
Detailed Reproduction Steps:
Using with function works, using it with classes it doesnt
Which versions of AngularJS, Material, OS, and browsers are affected?
Angular: v1.6.8
Angular Material: v1.1.5
Chrome: v63
Is there anything else we should know? Stack Traces, Screenshots, etc.
Playing with the angular-material js file, I found that changing the line 2644 from the compiled js file, inside the
MdCompilerService.prototype._createController
function, from:angular.extend(invokeCtrl.instance, locals);
toangular.extend(ctrl, locals);
made it worked.I also had to add the
$mdCompilerProvider.respectPreAssignBindingsEnabled(true);
so that line gets executed, because the lineangular.extend(invokeCtrl.instance, locals);
doesn't bind anythingThe text was updated successfully, but these errors were encountered: