I'm sending http request as following
this.http.post('/api/login', body)
.subscribe(
response => {
...
},
error=> {
...
});
But in new systems it gives pending then after that it gots cancelled sometimes.
After loading one time this never happens on that system again and works fine. Basically I'm redirecting all client routes to index.html. As follows:
app.get(['/', '/login', '/dashboard'],function(req, res, next){
res.sendFile(path.join(__dirname,'/../public/index.html'));
});
Where '/', '/login', '/dashboard'
are routes at my client end. As follows:
@RouteConfig([
{ path: '/', redirectTo: ['/Dashboard'] },
{ path: '/login', component: Login, as: 'Login' },
{ path: '/dashboard', component: Dashboard, as: 'Dashboard' }
])