Questions tagged refresh

Explore the latest questions and answers asked by our top developers.

window.location.reload() only refresh the home page, Why it does not refresh the other pages specifically using angular?

When I navigate from the home page to the menu page, the menu page should refresh once automatically after the navigation, but when I used the following codes, it refreshes the home page and then navigating to the menu page, where the menu page is not refreshed automatically 1)First Method: this.router.navigate([`locations/${locationId}/menu`]) .then(() => { window.location.reload(); […]

How to force reload and clear cache in Typescript?

it recently came to my attention that simply using window.location.reload() is not a hard refresh i.e. cache is cleared along with the refresh. I was then told to use window.location.reload(true) but I discovered this has since been deprecated. I am not sure how to determine whether or not the cache has been cleared, so I […]

By Trey Aesthetics
Published
Categorized as angular, caching, refresh, reload, typescript Tagged , , , ,

How to refresh dataTable after closing a popup

I have tried to refresh my table after adding a new articles to it using a popup but my code doesn’t do what I need to, it work normally but without refreshing my table this my createModal function createModal(){ const modalRef = this.modalService.open(SelectNewArticleModalComponent,{ size: ‘lg’ }); //modalRef.componentInstance.id = undefined; modalRef.result.then(() =>{ this.tournee = this.creationTourneeService.getTournee(); this.changeDetectorRef.detectChanges(); […]

How to refresh my DataTable after closing popup [closed]

I want to update my table after closing a modal but it doesn’t work. This is my function in TypeScript: createModal(){ const modalRef = this.modalService.open(NewArticleModalComponent,{ size: ‘lg’ }); modalRef.result.then(() =>{ this.tournee = this.creationTourneeService.getTournee(), this.changeDetectorRef.detectChanges(); () => { } } ); } Source: Angular Questions

Angular Refreshed all components when using RouterReuseStrategy and dynamic routing together

Angular version 9.1.12. I changed the routing config at the end of loading route config(RouteConfigLoadEnd event), code is like this: if (routerEvent instanceof RouteConfigLoadEnd) { let route = (this.router.config[0] as any)._loadedConfig.routes[0]; if (!route.children) { route.children = []; } if (route.component.name === ‘EntranceComponent’) { if (route.children.length < 1) { route.children.push({path: ‘ttt’, loadChildren: () => import(‘./entrance2/entrance2.module’).then(m => […]

Angular: Best practice to hold data on reload in dumb component?

the following setup is given: I have a simple master detail pattern. The master component pulls data from a REST API and passes the result to a detail component via input decorator. If I reload the detail component, I lose all the data and end up with a content-empty page. It seems wrong to me […]

By user src
Published
Categorized as angular, components, refresh, reload Tagged , , ,

Faster reload of components in Angular

I have created two Angular components: one for creating a new post and one for displaying all posts. After I press the button for creating a post I am being redirected to my PostList component, where all my posts are displayed. I used window.location.href, so that the PostList page can reload automatically, so that the […]

By Alessia
Published
Categorized as angular, refresh, routes Tagged , ,

Angular Observable data lost on refresh ,is there way to save data even after refresh

I am using BehaviourSubject from Shared Service whenever I refresh the page I am getting null as a response, it loses the last emit event data Source: Angular Questions

By Ashish Yadhuvanshi
Published
Categorized as angular, observable, refresh Tagged , ,

is there any way to call an async function before the page reload in angular project?

I need to call an async function when the user clicks on f5 or the browser reload. I already tried using 1- window:beforelolad but it doesn’t work with the browser reload button also cannot catch confirm value if it is yes or no. 2- tried navigation start and I can check the reload after the […]

By Mohamed Attia
Published
Categorized as angular, refresh, window Tagged , ,

In Angular 10: can I refresh data from Resolver of parent route?

I have a parent route which uses a Resolver to get data. I have several children of this route. The child Components subscribe to this data in their ngOnInit() methods. ngOnInit() { this.route.parent.data .subscribe((data: { collection: DataCollection }) => { this.collection = data.collection; }); } The Resolver only runs on the first access of one […]

By blogofsongs
Published
Categorized as angular, refresh, reload, resolver, state Tagged , , , ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq