Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dspace7 Angular
Manage
Activity
Members
Labels
Plan
Issues
42
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vtechworks
Dspace7 Angular
Commits
4debb543
Commit
4debb543
authored
5 years ago
by
Kristof De Langhe
Browse files
Options
Downloads
Patches
Plain Diff
AoT build errorfix - moving url matcher to exported function
parent
d8dd045a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/+lookup-by-id/lookup-by-id-routing.module.ts
+21
-19
21 additions, 19 deletions
src/app/+lookup-by-id/lookup-by-id-routing.module.ts
with
21 additions
and
19 deletions
src/app/+lookup-by-id/lookup-by-id-routing.module.ts
+
21
−
19
View file @
4debb543
...
...
@@ -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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment