Dabolus / polymer3-webpack-starter-kit

Polymer 3 Starter Kit with Webpack
MIT License
55 stars 6 forks source link

Add a static child view example #38

Closed logicalphase closed 6 years ago

logicalphase commented 6 years ago

I think it would super helpful if you could add an example of a child view example with routing. Something like as follows:

/view1
/view1/childview1

I think app-route explains a standard data route pretty well, but I know a lot new users want to know how to take a view and add a child view using the PSK. Not sure what would be the best way to achieve that with Polymer 3 PSK, but I suspect file structure could look like:

/view1
-- /view1.component.ts
-- /view1.style.scss
-- /view1.template.html
----- /childview1
--------- /childview1.component.ts
--------- /childview1.style.scss
--------- /childview1.template.html

Child URL: https://localhost:8080/view1/childview1

That may be over complicating it, or wrong in structure. But I think you can see where I'm headed. I know for me, polymer routing was the most difficult learning curve as I built out my first apps using a data model, and I wish there had been a documented example of how to start simple with fragment loading with a second level view route with the PSK. Does that make sense?

Thanks for the great work on this.

Dabolus commented 6 years ago

I will definitely do it, I had hard times trying to implement a subroute on my website too. The structure you provided seems right to me, because it really gives the idea of "a route inside a route". Btw I'm wondering why the original PSK does not provide a subroute example too, it would be really helpful for many people.

logicalphase commented 6 years ago

Sounds great. Thank you. I brought this issue up last year. There seemed to be agreement that there needed to be a wider range of routing examples, but none were added. I think it would ease transitioning into Polymer.

Dabolus commented 6 years ago

Added both a static and a dynamic subroute example with #51

logicalphase commented 6 years ago

Awesome. Thanks for doing that. ,👏

On Fri, Mar 30, 2018, 7:31 AM Giorgio Garasto notifications@github.com wrote:

Added both a static and a dynamic subroute example with #51 https://github.com/Dabolus/polymer3-webpack-starter-kit/pull/51

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dabolus/polymer3-webpack-starter-kit/issues/38#issuecomment-377514913, or mute the thread https://github.com/notifications/unsubscribe-auth/AYC27UGFOmP-FrPiJyebxCdc2qwsTdWFks5tjiW2gaJpZM4SvHZn .