I am new to Angular2. I could not find the answer to my question: how to replace the content of the answer if the service in my module fails. The scenario is that the module uses the hashed identifier from the URL to fulfill the service request. If the URL was copied incorrectly, the request fails. We thought that at this stage we should display page 404. Currently, when an error is detected, I am redirected to page 404. It seems to me that this behavior causes problems similar to those in the browser that the back operation is problematic.
Any idea?
,
:
{ // all unvalid urls, get redirected to page not found page path: '**', component: PageNotFoundComponent, }
URL-, , , :
this._router.navigateByUrl('/pagenotfound', { skipLocationChange: true })
skipLocationChange, , "" , "" 404, .
skipLocationChange
Source: https://habr.com/ru/post/1666417/More articles:Calculate days between two dates on AIX using Bash - dateAdding or subtracting color from an image in a pictureBox using C # - c #Make button map? - c #Leaks using GKStateMachine in GameplayKit - memory-leaksCreate a tuple with a variable type wrapped - c ++FABRIC_E_INVALID_ADDRESS при обращении к службе статистики без обслуживания через удаленный прокси-сервер - azureRails / ActiveRecord has_one association behavior when setting a child to "nil" - ruby | fooobar.comIterate over image pixels and rotate Colors - c #How to make a text box a div that contains the text of this text box. Is it possible? - javascriptImproved approach for updating multiple data - phpAll Articles