* Registers a `ReactiveController` to participate in the element's reactive * update cycle. The element automatically calls into any registered * controllers during its lifecycle callbacks. * * If the element is connected when `addController()` is called, the * controller's `hostConne
(controller: ReactiveController)
| 1068 | * @category controllers |
| 1069 | */ |
| 1070 | addController(controller: ReactiveController) { |
| 1071 | (this.__controllers ??= new Set()).add(controller); |
| 1072 | // If a controller is added after the element has been connected, |
| 1073 | // call hostConnected. Note, re-using existence of `renderRoot` here |
| 1074 | // (which is set in connectedCallback) to avoid the need to track a |
| 1075 | // first connected state. |
| 1076 | if (this.renderRoot !== undefined && this.isConnected) { |
| 1077 | controller.hostConnected?.(); |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | /** |
| 1082 | * Removes a `ReactiveController` from the element. |
nothing calls this directly
no test coverage detected
searching dependent graphs…