gmostert / ng2-breadcrumb

This is an angular 2 component that creates a breadcrumb trail. It hooks into the angular2/router, to dynamically build up the crumb trail once a component is routed to.
MIT License
102 stars 80 forks source link

Callback function with route parameters does not work as documented #35

Closed Delta388 closed 7 years ago

Delta388 commented 7 years ago

When I do this

breadcrumbService.addCallbackForRoute('/home/users/1', this.getNameForUser);
breadcrumbService.addCallbackForRouteRegex('^/home/users/[0-9]$', this.getNameForUser);

getNameForUser(id:string):string {
    return 'specific name for user with id';
}

C&P from the documentation, I get an error

Argument of type '(id: string) => string' is not assignable to parameter of type '() => string'.

Is this intentional? Looks as if the "regex"-Functions only accept parameterless functions for the callback.

gmostert commented 7 years ago

Nope, this is an oversight on my part, fixed in v0.5.2