@brandsync/angular 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -70,6 +70,22 @@ export class Example {
70
70
  The emitted event is a `BsCheckboxCustomEvent<boolean>` (a `CustomEvent` whose `detail` and `target` are
71
71
  typed), exported from `@brandsync/wc`.
72
72
 
73
+ ### Known limitation: programmatic `EventEmitter` subscription
74
+
75
+ Use template bindings (`(bsChange)="..."`) or a native listener. The proxies' `@Output()` fields are
76
+ **not** connected to the element's DOM events, so `componentRef.instance.bsChange.subscribe(...)`
77
+ (for example on a component created with `createComponent`) never emits. Angular attaches a native
78
+ DOM listener for every template event binding, which is why the template form works.
79
+
80
+ Connecting the emitters would make every `(bsChange)` template binding fire **twice** (once from
81
+ the native listener, once from the output), so this is intentionally left as is. To subscribe in
82
+ code, listen on the element:
83
+
84
+ ```ts
85
+ import { fromEvent } from 'rxjs';
86
+ fromEvent<BsSwitchCustomEvent<boolean>>(ref.location.nativeElement, 'bsChange').subscribe(e => {});
87
+ ```
88
+
73
89
  ## No `CUSTOM_ELEMENTS_SCHEMA`
74
90
 
75
91
  You do not need `CUSTOM_ELEMENTS_SCHEMA`. Importing a component class (`imports: [BsButton]`) is what