How to navigate to an exact url string in Angular2

Viewed 2256

I have a router set up with parameters

@RouteConfig([
    {
        path: 'article/:id/:title',
        name: 'ArticleContent',
        component: ArticleComponent
    }
])

Somewhere else, I am trying to read the href value of links that looks like this

href="article/45/titlehere"

and use Router navigate method to route to that url without having to break it up to single params. Is there a straight way in Angular2 to do that? like this?

_router.navigate("article/34/titlehere")

This isn't working, keep getting

EXCEPTION: TypeError: linkParams.reduce is not a function

PS. is already set correctly to site root

1 Answers
Related