angular2 routing - Component Router and children with routes on AngularJS v1 -


i trying create blog component (a component create subpaths pages/tags, etc) using new angular router. on every component, component template same (only path of component changes) show different data. goal provided standard blog component can shared on github.

the key problem, blog component template provide prev/next buttons.

the blog template should provided user (as every blog's structure different...)

how can done new component router?

route:

$routeconfig: [     {path: '/blog/...', name: 'blog', component: 'blog'}  ] 

component:

  bindings:     query       : '@'     posts       : '='     prevpage    : '&prev'     nextpage    : '&next'     pagesize    : '@'     tags        : '@'     currentpage : '@'     opts        : '@' 

routes example done ui router:

.state 'blog',   url: '/blog'   templateurl: '/app/blog/blog.html'   data:     pagesize: 3     query: '/blog' .state 'blog.paged',   url: '/page/:page' .state 'blog.filtered',   url: '/tags/:tag' .state 'blog.filtered.paged',   url: '/page/:page' 


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -