radio-group: Default Object Value problem
Actual Behavior:
I have a problem setting a default object value on a md-radio-group.
CodePen (or steps to reproduce the issue): *
https://codepen.io/matraned/pen/GmYZRm
AngularJS Versions: *
Angular v1.5.8 Materials v1.1.1
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.
You would think your issue would be solved by adding track by met.idMetodo to your ng-repeat, but alas.
The problem is that the render function of mdRadioButtonDirective compares object references and does not take the track by information into account. md-select does this via ng-model-options="{trackBy: xyz}".
This plunkr illustrates the issue further: https://embed.plnkr.co/YpIclp3dBypvILTvq1Fh/
The expected result in the plunkr is that the correct radio button (2) should be selected on load.
+1
Has anything come from this bug? I am having the same problem that @sviams has exampled.
+1
This is a duplicate of https://github.com/angular/material/issues/6225. We would welcome a PR to add trackBy support to md-radio-group.