I have an Angular 9 application where Angular Component properties binds to RxJS observables. Here I am trying to replace Angular Components with Polymer custom element (paper-input).
What is my observation? I am unable to bind custom element property with RxJS observables which I was able to with Angular Component properties.
How to reproduce? For showing what I am facing I have stackblitz sample with custom-element(paper-input) binds to an observable.
app.component.html
<paper-input [label]="price$ | async" ></paper-input>
app.component.ts
import { Observable } from 'rxjs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
})
export class AppComponent {
price: Observable<string>;
constructor() {
this.price = Observable.of("230$");
}
}
Full Code: https://stackblitz.com/edit/angular-examples-mu72vs
Expectation is I am able to bind the label property of paper-input (Polymer) to Observable and when ever there is a change gets reflected to custom element property. In actual I am not seeing the changes reflected to label property and it is empty.
Here I assumed the observable subscription will happen as part of AsyncPipe using while binding. But that is not happening with a custom element property.
What is the best way to achieve custom element property binding with RxJS Observables?
Regards Basanth