Michael Karén
1 min readDec 11, 2018

--

It’s working well so far.
A few changes needed to get it working in child modules.
Also needs some work to get parameters working.

I moved the paths to the routing modules and send them in as data to the resolver. Also added module path to paths.

export const paths = {
module: ‘modulepath’,
home: ‘home’,

}

{ path: ‘**’, resolve: { path: PathResolveService }, data: paths, component: PageNotFoundComponent }

Resolver edits:
const paths = route.data;
const module = paths.module;

// map module path to path in dictionary
const dictionary = Object.values(paths)
.map((path: string) => module ? `${module}/${path}` : path)
.filter((path: string) => Math.abs(path.length — typoPath.length) < threshold);

Hope it makes sense.

--

--

Michael Karén
Michael Karén

Written by Michael Karén

Frontend Architect • JavaScript Enthusiast • Educative.io Author • ngVikings organizer.

Responses (1)