Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Lazy Load Module - Angular MVC Template - Hard reload doesn't work? #848

Closed
aherrick opened this issue Apr 7, 2017 · 1 comment
Closed

Comments

@aherrick
Copy link

aherrick commented Apr 7, 2017

I'm seeing something strange.

I've followed this to enable Lazy Loading of modules in my App.

7ded0a0

Once the App loads and I navigate to the route via URL it works without issue. URL is /configuration just to note.

However, once I'm on that /configuration module, if I do a hard refresh, it's like the MVC backend kicks in and attempts to resolve the Controller/Action (which obviously doesn't exist)

1

My MVC routes haven't changed and are base:

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

Am I missing something here? Why would "MVC" be trying to load /configuration instead of letting it fall to Angular?

NOTE: If I change the route to "config" reloading/navigating works as expected. Is something special about "configuration" (seems very odd to me unless I'm overlooking something)

@aherrick
Copy link
Author

My mistake. I had an "Index" view setup in my "Configuration" controller. No issue here!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant