adal - angular 4 - first load filter is not working -
i have angular 4 application azure ad authentication. after user logged in redirecting user home component. on home component calling api data , load in grid. have text box user can filter grid data , have written custom pipe that. problem : when home component first loads, data coming correctly filter not working until refresh page manually first time. below route configuration.
const approutes: routes = [ { path: '', redirectto: '/login', pathmatch: 'full' }, { path: 'home', component: hcohomecomponent,canactivate: [oauthcallbackhandler]}, { path: 'login', component: logincomponent }, { path: 'hco/:hcoid', component: hcodetailscomponent, canactivate: [oauthcallbackhandler]}, { path: 'hco/edit/:hcoid', component: hcoeditcomponent,canactivate: [oauthcallbackhandler] }, { path: 'hcoevent/:hcoeventid', component: hcoeventdetailscomponent, canactivate: [oauthcallbackhandler] }, { path: 'hcoevent/edit/:hcoeventid', component: hcoeventeditcomponent, canactivate: [oauthcallbackhandler] }, { path: 'id_token', component: oauthcallbackcomponent, canactivate: [oauthcallbackhandler] }, { path: 'access_token', component: oauthcallbackcomponent, canactivate: [oauthcallbackhandler] }, ]; export const routing: modulewithproviders = routermodule.forroot(approutes,{ usehash: true });
i have filter this,
<div *ngfor="let hco of lstresult | searchfilter: {name: searchid}">
where searchid textbox value.
home component has below code fetching data api using service.
getallhcos() { this.msg = 'loading...'; this.hcoservice.get() .subscribe((hcos: any) => { this.zone.run(() => { this.lstresult = hcos; this.msg = ''; }) }, error => this.msg = ''); }
please let me know if doing wrong here. , when call edit on first load not working, have refresh page , works properly.
Comments
Post a Comment