I've read over the documentation for the new Angular router. The example they have for routing to a variable is this:
Component/Module:
angular.module('myApp', ['ngFuturisticRouter'])
.controller('AppController', ['$router', function($router) {
$router.config({ path: '/user/:id' component: 'user' });
this.user = { name: 'Brian', id: 123 };
});
HTML/Template:
<div ng-controller="AppController as app">
<a router-link="user({id: app.user.id})">{{app.user.name}}</a>
</div>
Here is my component:
@RouteConfig([
{ path: '/', component: Home, as: 'home' },
{ path: '/displays/:id', component: DisplayDetails, as: 'display-details' }
])
And my HTML/Template:
<div class="col-md-3" *ng-for="#display of displays">
<a [router-link]="['/display-details({id: display.id})']"><display-card ></display-card></a>
</div>
I've also tried instead of putting the component alias (display-details) I've tried putting the actual path and the component it self but they all give me the same error:
EXCEPTION: Component "App" has no route named "display-details({id: display.id})". in [null]
[router-link]="['/display-details', {id: display.id}]", btw, what version are you using?