
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@impactdk/ngx-routing-utils
Advanced tools
This package is a compilation of different tools to cater to your dynamic routing needs for Angular.
The package contains the following:
This is a module that allows your application to register a dynamic route (**) and have it resolved and parsed into a set of components.
This is especially useful with a CMS as backend, where you don't know all routes before runtime.
import { DynamicRoutingModule } from '@impactdk/ngx-routing-utils';
@NgModule({
imports: [
...,
DynamicRoutingModule
],
})
class SomeModule {}
template attribute, which is used to reference the page components; this means that your backend should understand which page components are available in order to resolve the correct one.export interface IPage {
template: string;
title: string;
content: string;
metaDescription?: string;
}
export class PageResolve implements Resolve<IPage> {
resolve(route: ActivatedRouteSnapshot) {
return this.http.get<IPage>('/' + route.url);
}
}
// Declare your page components
// NB! Make sure that these are registered as entryComponents in your module
// NB! Make sure to have a static reference in your page components to be able to locate them through the `template` property of the IPage interface, i.e. `static ref: string = 'frontpage'`
const pageComponents = [
FrontpageComponent,
SubpageComponent,
ProductListComponent,
ErrorpageComponent,
];
@Component({
template: `
<article>
<dynamic-component
[component]="component"
[inputs]="inputs"
></dynamic-component>
</article>
`,
})
export class PageComponent implements OnInit {
component: any;
inputs: { data?: string } = {};
constructor(
private activatedRoute: ActivatedRoute,
private title: Title,
private meta: Meta
) {}
ngOnInit() {
// Read the content from the route snapshot (this 'content' is the name of the resolve)
let data: IPage = this.activatedRoute.snapshot.data.content;
if (!data) {
return;
}
// Find the ComponentClass of the desired pageComponent (based on template)
this.component = pageComponents.find(
component => component.ref === data.template
);
if (!this.component) {
this.component = ErrorpageComponent;
data =
'No matching PageComponent was found - tried using: ' +
data.template;
}
this.inputs['data'] = data.data;
// SEO-related information extracted from the data object
this.title.setTitle(data.title);
if (data.metaDescription) {
this.meta.addTag({
name: 'description',
content: data.metaDescription,
});
}
}
}
const routes: Routes = [
{
path: '**',
component: PageComponent,
resolve: {
content: PageResolve,
},
},
];
This package also includes a couple of routing strategies
This strategy will prevent reuse of components on all your route paths
@import { NoReuseStrategy } from '@impactdk/ngx-routing-utils';
@NgModule({
providers: [
...
{
provide: RouteReuseStrategy,
useClass: NoReuseStrategy,
}
]
})
This strategy grants you the possibility to define on each route path whether it is reusable or not
@import { NoReuseStrategy } from '@impactdk/ngx-routing-utils';
@NgModule({
providers: [
...
{
provide: RouteReuseStrategy,
useClass: NoReuseStrategy,
}
]
})
const routes: Routes = [
{
path: '**',
component: PageComponent,
data: {
reuse: false
},
resolve: {
content: PageResolve
}
}
];
You have to enable anchorScrolling in RouterModule to make scrolling to an Id work with routerLink and fragment. The Angular doucmentation says it will be enabled by default in the future...
@NgModule({
imports: [
RouterModule.forRoot(routes, {
scrollPositionRestoration: 'enabled', // ..."This will be default in the future" from angular
anchorScrolling: 'enabled', // ..."This will be default in the future" from angular
}),
],
})
export class AppRoutingModule {}
Original idea by Filip Bruun Bech-Larsen (@filipbech)
Adapted by Jacob Overgaard (@jacob87)
FAQs
A compilation of routing utils for Angular
The npm package @impactdk/ngx-routing-utils receives a total of 8 weekly downloads. As such, @impactdk/ngx-routing-utils popularity was classified as not popular.
We found that @impactdk/ngx-routing-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.