Issue
I have this errror with that code
ERROR Error: InvalidPipeArgument: '' for pipe 'AsyncPipe'
@Injectable()
export class EmployeePortalService implements Resolve<any>{
areas: any[]
organs: any[]
units: any[]
selectedArea: any
selectedOrgan: any
constructor(
private http: HttpClient
) {
}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> | Promise<any> | any {
return new Promise<void>((resolve, reject) => {
Promise.all([this.loadAll()]).then((response: any) => {
resolve(response)
}, reject)
})
}
loadAll(): Promise<any>{
return new Promise((resolve, reject) => {
this.http.get("/api/getWorkAreas").subscribe((response: any) => {
this.areas = response
resolve(response)
}, reject)
})
}
}
}
Could anybody find the way to solve that. It always appear when I load data from the server
I want find the way to stop this error that appear in browser console input
Solution
At the end I discover that my fault was an async pipe that is not needed in the templeate code
Answered By - Marcos Randulfe Garrido
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.