My problem is that every time I upload my link. Example: " https://www.example.com/ " it will be redirected to " https://www.example.com/design-brief ", since I configured it in my routing.ts. But when I use the link " https://www.example.com/design-brief " and enter in my address bar, it will show an error in the console log. "GET https://www.example.com/design-brief 404 ()"
const APP_ROUTES: Routes = [ { path: 'design-brief', component: DesignBriefComponent }, { path: 'design-evaluation', component: DesignEvaluationComponent }, { path: '', redirectTo: '/design-brief', pathMatch: 'full' }, { path: "**",redirectTo:"/design-brief" } ];
Here is my code in my routing.ts
. , .
2 :
-, index.html , 404 - , Angular .
Strategy Hash, . , URL- , , .
**, ** pathMatch 'full':
const APP_ROUTES: Routes = [ { path: 'design-brief', component: DesignBriefComponent }, { path: 'design-evaluation', component: DesignEvaluationComponent }, { path: "**",redirectTo:"design-brief",pathMatch: 'full' } ];
(/) -
I solved this using the Hash placement strategy. Add the following code to the @ngModule import part and the prefix of your entire C # hyperlink and also link to the offecial link for information
RouterModule.forRoot( appRoutes,{ useHash: true } )
Source: https://habr.com/ru/post/1684149/More articles:MS Access 2016 Treeview Error: "There is no object in this control. Runtime Error 438" - vbaIt's safe to have two versions of Python in a Cloudera virtual machine without installing Python - pythonOverhead of memory of typed arrays and strings - javascriptWhat is the fix for this normalizeAndCheck (UnixPath.java) NullPointerException in Gradle sync? - androidCall termination call from format - formatHow can I get an item from Vec to Rust? - collectionsHow to make sure that each input field has a greater value than the value of the previous input? - javascriptКак использовать параметризованный SQL с dplyr? - rHiding sidebar navigation for wep application - htmlUsing templates instead of a bridge template in C ++ - c ++All Articles