node.js - Angular 2 http request is giving pending/cancelled status on new system -
i'm sending http request following
this.http.post('/api/login', body) .subscribe( response => { ... }, error=> { ... });
but in new systems gives pending after gots cancelled sometimes.
after loading 1 time never happens on system again , works fine. i'm redirecting client routes index.html. follows:
app.get(['/', '/login', '/dashboard'],function(req, res, next){ res.sendfile(path.join(__dirname,'/../public/index.html')); });
where '/', '/login', '/dashboard'
routes @ client end. follows:
@routeconfig([ { path: '/', redirectto: ['/dashboard'] }, { path: '/login', component: login, as: 'login' }, { path: '/dashboard', component: dashboard, as: 'dashboard' } ])
Comments
Post a Comment