Documentation Request
Clearer documentation on how to change the MatCheckboxClickAction of a checkbox
The current documentation is unhelpful. It is unclear how to alter the default value of MatCheckboxClickAction. An example would be helpful.
See Current Documentation
I've read the PR with the updated docs but still couldn't implement it. Any way it could be updated with a working sample? It would be very helpful. Thanks
+1
A working example on stackblitz:
https://stackblitz.com/edit/angular-zstr9w?file=main.ts
Changing provided value in providers: [{provide: MAT_CHECKBOX_CLICK_ACTION, useValue: 'check-indeterminate'}] in main.ts will have different results.
@tinayuangao
Thanks for the sample provided. I managed to get it working on https://stackblitz.com/edit/angular-zstr9w-tlgtfj?file=app%2Fcheckbox-configurable-example.ts
But it is still not clear how would I apply it to a single checkbox on my component? Should I create an TriState component containing a MatCheckbox component in it? Or is there a better way?
Thanks
I have implemented it by creating a new component.
Would like to know if it is the correct approach?
Here is an example: https://stackblitz.com/edit/angular-uew4l8
Could anyone assess it? Thanks!
Thanks @tinayuangao and @hobojoe!
Why can't this just be an option on the checkbox itself :-/
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
Why can't this just be an option on the checkbox itself :-/