问题
My angular site works great, but when you click
into a project it loads the page, right away and sometimes there is a flash
while the images are pulled from the API, id
like a 1
second delay, or page transition effect.
but i'm not sure how to implement this in Angular 2. Interested to hear what others are doing ?
Thanks in advance
回答1:
You can implement CanDeactivate interface, something like this:
routerCanDeactivate(currTree?: RouteTree, futureTree?: RouteTree): Promise <boolean> {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(true), 1000);
})
}
来源:https://stackoverflow.com/questions/37710936/delay-navigating-to-next-page