ionic-team / ionic-pwa-toolkit

Build lightning fast Progressive Web Apps with zero config and best practices built-in. Go from zero to production ready with Ionic and Stencil (Web Components).
MIT License
633 stars 74 forks source link

Blank name on the Profile page #78

Closed dandv closed 5 years ago

dandv commented 5 years ago

I've just cloned this repo, ran npm install then npm start, and at http://localhost:3333/profile/ionic I see image

The page could explain how to pass the name parameter. I tried /profile/ionic?name=joe but that didn't help.

kael commented 5 years ago

The path to pass is of type <ion-route url="/profile/:name" component="app-profile" />. See in my-app.tsx.

davec21 commented 5 years ago

Getting this too, looks like the parameter isn't being properly passed through? I tried changing the name of the property to person and it is still blank. Console.logging the passed in param is dumping an object not the expected string.

kael commented 5 years ago

Lazy to test, what gives: http://localhost:3333/profile/foo & http://localhost:3333/profile/bar ?

davec21 commented 5 years ago

Not sure what you mean, but when I do it it just treats it like no parameter is passed.

sudsy commented 5 years ago

Yep, seeing this too. Tried to find some docs or a test for path matching for ion-router. Had a look here: but didn't find anything that helped.

jwuliger commented 5 years ago

Same problem here :/

arby50 commented 5 years ago

In AppProfile, the following line(s) is the problem: @Prop({ connect: 'ion-toast-controller' }) @Prop() name: string;

switch the order: @Prop() name: string;
@Prop({ connect: 'ion-toast-controller' })

and it works. I changed the Prop name to "naaaaame" and did a global search using Chrome DevTools to see that it was a property of the ion-toast-controller until I switched the order.

jwuliger commented 5 years ago

Thanks @arby50 I cant believe I missed that lol. Good deal!

jgw96 commented 5 years ago

Hello all! I just pushed a commit to the Toolkit to fix this issue. Thanks!