mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
Merge pull request #516 from atmire/AoT-build-errorfix
AoT build error fix
This commit is contained in:
@@ -8,25 +8,7 @@ import { hasValue, isNotEmpty } from '../shared/empty.util';
|
|||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{
|
{
|
||||||
matcher: (url) => {
|
matcher: urlMatcher,
|
||||||
// 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;
|
|
||||||
},
|
|
||||||
canActivate: [LookupGuard],
|
canActivate: [LookupGuard],
|
||||||
component: ObjectNotFoundComponent }
|
component: ObjectNotFoundComponent }
|
||||||
])
|
])
|
||||||
@@ -39,3 +21,23 @@ import { hasValue, isNotEmpty } from '../shared/empty.util';
|
|||||||
export class LookupRoutingModule {
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user