I have some components of which one with dynamic routes.
the dynamic routes are added as,
let config = [];
for(let i = 0; i < this.pages.length; i++
Check if the route exists before adding it
for(let i = 0; i < this.pages.length; i++) {
if(!router.registry.hasRoute(this.pages[i].name, UsersComponent)) {
config.push({
path: this.pages[i].slug,
name : this.pages[i].name,
component: PersonComponent,
data : {
name : this.pages[i].name,
slug : this.pages[i].slug
}
});
}
}
Plunker