Answer the question
In order to leave comments, you need to log in
How to use async pipe correctly?
Hello, I am getting this error:
core.js:6210 ERROR Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'
at invalidPipeArgumentError (common.js:4212)
at AsyncPipe._selectStrategy (common.js:4314)
at AsyncPipe._subscribe (common.js:4304)
at AsyncPipe.transform (common.js:4292)
at Module.ɵɵpipeBind1 (core.js:25782)
at DataComponent_div_10_Template (data.component.html:54)
at executeTemplate (core.js:9600)
at refreshView (core.js:9466)
at refreshEmbeddedViews (core.js:10591)
at refreshView (core.js:9490)
getDataTypeArr(): void {
this.arrDataType$ = this.dataService.getArrInSelectDataType().pipe(take(1)).subscribe( (res: []) => {
console.log('Arr DATA TYPE', res);
});
}
ngOnInit(): void {
this.getDataTypeArr();
}
<div class="box-for-select">
<mat-form-field appearance="standard">
<mat-label>Select data type</mat-label>
<mat-select>
<mat-option>None</mat-option>
<mat-option *ngFor="let item of arrDataType$ | async " [value]="item">
{{item}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
Arr DATA TYPE (3) ["CRYPTO", "FX", "USSTOCK"]
Answer the question
In order to leave comments, you need to log in
static call to dynamic method, should be $this->getMenuHtml
first, why does the controller generate html code? It is not right.
second, what does the menu have to do with the User controller?;
well, on the topic, you have already been pointed out where the error is - self::getMenuHtml($category['childs'])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question