When I navigate to a deep link url in my app directly (i.e. by clicking a 
link in an email or just typing the full url in the address bar) the app 
loads and displays the view I've requested.  However if that URL has a 
route parameter I get an error.  

Example url that works:  http://localhost:8088/homedetail/

Example url that doesn't work: http://localhost:8088/homedetail/1



For the URL that doesn't' work I get the following error:

Error: (SystemJS) Error: XHR error (404 Not Found) loading 
http://localhost:8088/homedetail/app/app.js
   at XMLHttpRequest.wrapFn [as _onreadystatechange] 
(http://localhost:8088/node_modules/zone.js/dist/zone.js:769:30)
   at ZoneDelegate.invokeTask 
(http://localhost:8088/node_modules/zone.js/dist/zone.js:356:38)
   at Zone.runTask 
(http://localhost:8088/node_modules/zone.js/dist/zone.js:256:48)
   at XMLHttpRequest.ZoneTask.invoke 
(http://localhost:8088/node_modules/zone.js/dist/zone.js:423:34)

        Error loading http://localhost:8088/homedetail/app/app.js 



I'm using the new v3 router and here are the routes that I have configured


export const routes: RouterConfig = [
    { path: '', component: Login },
    { path: 'login', component: Login },
    { path: 'register', component: RegisterUser },
    { path: 'portalhome', component: PortalHome, canActivate: [AuthGuard] },
    { path: 'customerprofile', component: CustomerProfile, canActivate: 
[AuthGuard] },
    { path: 'homedetail/:homeId', component: HomeDetail, canActivate: 
[AuthGuard] }
];


 
I don't understand why it's trying to load an app located at the 
subdirectory or the requested URL when a route paramater is specified.  I'm 
using this in an MVC project where all routes are mapped to the index view 
of the home controller (which is the root of the website).


            routes.MapRoute(
                name: "Default",
                *url: "{*url}",*
                defaults: new { controller = "Home", action = "Index", id = 
UrlParameter.Optional }
            );


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to