What does the app.js URL look like when you got to "/homedetail/"?

On Mon, Jun 27, 2016 at 11:21 AM, HisDivineShadow <
[email protected]> wrote:

> It does do that, that is what the {*url} parameter is doing.  The error
> shown is in SystemJS which wouldn't be getting loaded if the MVC routing
> weren't routing correctly to the root app correctly.
>
>
>
> On Monday, June 27, 2016 at 9:03:16 AM UTC-5, Lucas Lacroix wrote:
>>
>> You need to change your webserver's router to point all of those paths
>> back to the real applications root path. This isn't something that Angular
>> can do for you.
>>
>> This is why I chose to use the HashLocationStrategy instead of the
>> default. That way, I do not need to much about with the webserver's routing.
>>
>> -Luke
>>
>> On Mon, Jun 27, 2016 at 9:57 AM, HisDivineShadow <[email protected]>
>> wrote:
>>
>>> 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.
>>>
>>
>>
>>
>> --
>> Lucas Lacroix
>> Computer Scientist
>> System Technology Division, MEDITECH <http://ehr.meditech.com>
>> 781-774-2293
>>
> --
> 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.
>



-- 
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH <http://ehr.meditech.com>
781-774-2293

-- 
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