Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd
Moving the toggle doesn't change the actual model property.
It's represented on the examples tab of this page https://material.angular.io/components/component/slide-toggle
If [(ngModel)] works well for this control, why [checked] is created?
The [checked]
input is a one-way data binding and can be used without the FormsModule
.
It exists for convenience and to be aligned with the native input elements.
This is very confusing and I think at least the docs should be updated. The example / demo shows an md-slide-toggle with a checked property and no ngModel. I think it's very uncommon that anyone will want a slide toggle that does input but not output.
https://material.angular.io/components/component/slide-toggle
[color]="color"
[checked]="checked"
[disabled]="disabled">
Slide me!
@pdavin That's true. It's very unlikely that some just uses the [checked]
input binding.
Maybe we should also have a second demo that is very simple and shows the usage with an NgModel.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@pdavin That's true. It's very unlikely that some just uses the
[checked]
input binding.Maybe we should also have a second demo that is very simple and shows the usage with an NgModel.