Skip to content
Snippets Groups Projects
Commit 4debb543 authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

AoT build errorfix - moving url matcher to exported function

parent d8dd045a
Branches
Tags
No related merge requests found
......@@ -8,25 +8,7 @@ import { hasValue, isNotEmpty } from '../shared/empty.util';
imports: [
RouterModule.forChild([
{
matcher: (url) => {
// The expected path is :idType/:id
const idType = url[0].path;
// Allow for handles that are delimited with a forward slash.
const id = url
.slice(1)
.map((us: UrlSegment) => us.path)
.join('/');
if (isNotEmpty(idType) && isNotEmpty(id)) {
return {
consumed: url,
posParams: {
idType: new UrlSegment(idType, {}),
id: new UrlSegment(id, {})
}
};
}
return null;
},
matcher: urlMatcher,
canActivate: [LookupGuard],
component: ObjectNotFoundComponent }
])
......@@ -39,3 +21,23 @@ import { hasValue, isNotEmpty } from '../shared/empty.util';
export class LookupRoutingModule {
}
export function urlMatcher(url) {
// The expected path is :idType/:id
const idType = url[0].path;
// Allow for handles that are delimited with a forward slash.
const id = url
.slice(1)
.map((us: UrlSegment) => us.path)
.join('/');
if (isNotEmpty(idType) && isNotEmpty(id)) {
return {
consumed: url,
posParams: {
idType: new UrlSegment(idType, {}),
id: new UrlSegment(id, {})
}
};
}
return null;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment