JonUK / webpack4-es6-knockout

Project to review the best use of Webpack 4 with ES6 and Knockout.
3 stars 0 forks source link

Using a Navbar to Switch Page Components. #3

Open stephaniie2 opened 5 years ago

stephaniie2 commented 5 years ago

Hi, your package works perfectly. I love how its divided between PageComponents and Components.

But if I want to display different PageComponents from a Link. How to do ?

Say Navbar has 3 links.. "home" "page1" and "page2"
And I have 3 page components ( home, page1, page2)

How to swap page -components through a navbar?

JonUK commented 5 years ago

Hi. Good to hear this code has been useful for you.

This repo was just for proving out some concepts and I haven't got round to adding routing support.

There is a good article that explains how to use Crossroads and Hasher with KO. https://sumitmaitra.wordpress.com/2014/08/04/part-3-ko-components-routes-and-hashes/