aurelia - Child routes are refreshing the parent route -
my child routes in aurelia refreshing parent route. don't know causing that, me? have following situation:
app.js
config.map([ { route: ':username', moduleid: './components/profile/profile', name: 'profile', nav: false }, ]);
profile.html
<div class="profile-post-content"> <div class="profile-menu"> <a active-menu route-href="route: profile; params.bind: { username: username }" class="profile-menu-item menu-active"> <label>posts</label> </a> <a active-menu route-href="route: following" class="profile-menu-item"> <label>following</label <p>${model.following}</p> </a> <a active-menu route-href="route: followers" class="profile-menu-item"> <label>followers</label> </a> <a active-menu route-href="route: albums" class="profile-menu-item"> <label>albums</label> </a> </div> <router-view></router-view> </div>
profile.js
configurerouter(config, router){ config.map([ { route: '', moduleid: '../profile/feed', name: 'userfeed', title: 'posts', nav: true}, { route: 'following', moduleid: '../profile/following', name: 'following', title: 'following', nav: true}, { route: 'followers', moduleid: '../profile/followers', name: 'followers', title: 'followers', nav: true}, { route: 'albums', moduleid: '../profile/albums', name: 'albums', title: 'albums', nav: true}, ]); this.router = router; }
when click in link (post, following, etc), profile.html reloaded.
Comments
Post a Comment