angular-realworld-example-app icon indicating copy to clipboard operation
angular-realworld-example-app copied to clipboard

clicking your feed not showing

Open mohammadjouhari opened this issue 6 years ago • 1 comments

Dear Developers,

Hope evrything is fine.

clicking your feed not filtirring data.

Any reason ? Capture Capture2

mohammadjouhari avatar Nov 01 '19 09:11 mohammadjouhari

I fixed the issue by modifying the constructor ( private apiService: ApiService, private userService: UserService ) {} currentUser: User; query(config: ArticleListConfig): Observable<{articles: Article[], articlesCount: number}> { console.log(config); const params = {}; if((config.type != 'feed')) { Object.keys(config.filters) .forEach((key) => { params[key] = config.filters[key]; }); return this.apiService .get( '/articles', new HttpParams({ fromObject: params }) ); } else { this.userService.currentUser.subscribe( (userData) => { this.currentUser = userData; } ); params['author'] = this.currentUser.username; return this.apiService .get( '/articles', new HttpParams({ fromObject: params }) ); } }

mohammadjouhari avatar Nov 01 '19 12:11 mohammadjouhari