I'm developing an angular 2 app. I found a lot but I didn't find the right solution for my problem. So essentialy, if I run the app with "ng serve" all works fine, if I refresh the page (for example http://localhost:4200/home) it works fine. The problem occurs when I build the app in a war and deploy it on wildfly with a different context path (ex. /myapp). At this point the routing navigation works fine but if I refresh the page I receive a "Not found error". My base href on index.html is ""
Angular 2 refresh issue under context path
697 Views Asked by Fabrizio P At
1
There are 1 best solutions below
Related Questions in ANGULAR
- Is it possible to use ES5 JavaScript with Angular 2 instead of TypeScript?
- Module '"angular2/angular2"' has no exported member 'For'
- import syntax in typescript creating another js file in visual studio
- Separate ts file for imports
- How to use an AngularJS 2 component multiple times in the same page?
- injectables not working in angular 2.0 latest build 26
- Does angular2 bootstrap have a way to dynamically target elements like it does in angular 1.x
- Import {} from location is not found in VS Code using TypeScript and Angular 2
- Angular 2/Typescript: require not found
- ng-switch in Angular2
- Angular 2 import issue: "Zone already exported on window the object!"
- How to make FileReader work with Angular2?
- Writing the most basic Unit test in Angular 2?
- Angular2: Creating child components programmatically
- AngularJS - TypeError: Cannot read property 'canonicalUrl' of undefined
Related Questions in ROUTES
- Routing Url that has no action name
- Implementing find node on torrent kademlia routing table
- Get packet that's being routed
- Preserve `$location.search()` in angular `redirectTo`?
- Why does this MVC action return a 404 response in IE11
- Backbone: Best way to prevent routes (and url change)
- ASP.NET MVC routing 404
- Change the name of parent :parent_id parameter in Routing resources for Rails4
- Where should I put Symfony third-party bundle's routing configuration?
- How to route by call method in proxy with WSO2?
- Asp.net MVC Routelink null controller parameter
- using dart route package url got error 404
- Re-transmission concept in TCP
- Network unreachable when address is IPv6 in Buildroot
- rails_admin add custom controller in namespace admin
Related Questions in REFRESH
- How to refresh a listview within a Fragment
- Android HorizontalLitview refresh is not working
- Stop script execution after refresh
- Stop form from refreshing the page on submit
- How to stay on active tab after refresh on page?
- How to regenerate indexes after removing element
- Alternatives to refresh to avoid blacklisting
- How to Update JFrame Components?
- How to reload list view?
- does http-equiv Refresh meta tag URL get a leading slash?
- Refreshing SQL view after adding a default constraint to one of its tables
- PHP - Prevent Duplicate Form Requests On Refresh?
- How to refresh datagridview with button?
- Refreshing an entire Linq to SQL DataContext
- Javascript/JQuery function not working on first page load. Then works on refresh
Related Questions in CONTEXTPATH
- Deploye two wars with different domain name but same context-path in same jboss-4.0.3
- How to set Spring root context path
- Angular 2 refresh issue under context path
- contextPath cannot be resolved as a member of a request
- Setting Context Path in Tomcat7 to change ROOT
- Application not accessible with just the application name in the url on maven install
- Redirect to URL without trailing slash doesn't work in Websphere 8.5.5
- Context path in URIs of static resources, do I really need to specify it?
- tomcat unable to get ServletContext.getContextPath()
- Apache - How to get resources from the context path and not default when trying to get from /
- jboss external file access
- hot deploy an exploded webapp in embedded jetty 9.4.x
- How to change context path in java file
- How to define a root context outside of the war in jboss 5.1?
- StringBuffer going to append path for every method call
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Solved using {provide: LocationStrategy, useClass: HashLocationStrategy} in app modules