Angular Service Workers Routes

2019-03-28 07:24发布

问题:

I have built an app with Angular Service worker and it is all working well offline except for the routes. If I go to the base url the app loads fine but if I go to any of the other routes while offline I get an offline error.

My ngsw-manifest.json looks like

    {
        "routing": {
            "index": "/index.html",
            "routes": {
                "/": {
                "match": "exact"
                },
                "/home": {
                "match": "exact"
                },
                "/paramaterlessroutes": {
                "match": "exact"
                },
                "/routeswithparamaters": {
                "match": "prefix"
                }
            }
        }
    }