MCPcopy Create free account
hub / github.com/angular/components / toggle

Method toggle

src/cdk-experimental/selection/select-all.ts:53–64  ·  view source on GitHub ↗

* Toggles the select-all state. * @param event The click event if the toggle is triggered by a (mouse or keyboard) click. If * using with a native ` `, the parameter is required for the * indeterminate state to work properly.

(event?: MouseEvent)

Source from the content-addressed store, hash-verified

51 * indeterminate state to work properly.
52 */
53 toggle(event?: MouseEvent) {
54 // This is needed when applying the directive on a native <input type="checkbox">
55 // checkbox. The default behavior needs to be prevented in order to support the indeterminate
56 // state. The timeout is also needed so the checkbox can show the latest state.
57 if (event) {
58 event.preventDefault();
59 }
60
61 setTimeout(() => {
62 this._selection.toggleSelectAll();
63 });
64 }
65
66 private readonly _destroyed = new Subject<void>();
67

Callers 1

Calls 1

toggleSelectAllMethod · 0.80

Tested by

no test coverage detected