Issue
I'm new to ionic. I'm trying to refresh the same page after user selects an option from dropdown. but the my dropdown is in another component(somehow like partial view) and I used this in other components. I tried navigating but it didn't refresh the page. I want when user selects an option that component will refresh. the ngOnInit method works fine btw. This is my partial view component:
navigateTo(path: string) {
localStorage.setItem('selectedapp', this.appId);
this.router.navigate([path]);
}
this is the html of this component:
<ion-item *ngIf="!isPrivate">
<ion-label>فروشگاه های من</ion-label>
<ion-select [(ngModel)]="appId" (ionChange)="navigateTo(model[0].url)" ok-text="تایید" cancel-text="کنسل" [value]="00000000-0000-0000-0000-000000000000">
<ion-select-option value="00000000-0000-0000-0000-000000000000">همه</ion-select-option>
<ion-select-option value="{{item.applicationId}}" *ngFor="let item of model">{{item.applicationTitle}}</ion-select-option>
</ion-select>
</ion-item>
This is where I used above component's tag in another html page:
<app-user-applications returnUrl="prizePackages"></app-user-applications>
in this case I want to refresh the prizePackages page. what should I do?
Solution
This problem resolved using
window.location.reload();
Answered By - niki tmb
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.