Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize core components and routes #5

Merged
merged 7 commits into from Mar 11, 2020
Merged

Initialize core components and routes #5

merged 7 commits into from Mar 11, 2020

Conversation

@van-fs
Copy link
Member

van-fs commented Mar 10, 2020

This PR provides the basic components for the app:

  • Creates cart, checkout, products, and thankyou component. Each component is the boilerplate ng create component output.
  • Routes were added to components.
  • The toolbar was updated to include a cart button and links to test the router.

This very much mirrors the React app (except this is Angular).

{ path: 'checkout', component: CheckoutComponent },
{ path: 'products', component: ProductsComponent },
{ path: 'thankyou', component: ThankYouComponent },
{ path: '**', redirectTo: '' },

This comment has been minimized.

Copy link
@patrick-fs

patrick-fs Mar 10, 2020

Member

{ path: '**', redirectTo: '' }

What's the behavior here?

This comment has been minimized.

Copy link
@van-fs

van-fs Mar 10, 2020

Author Member

The ** path in the last route is a wildcard. The router will select this route if the requested URL doesn't match any paths for routes defined earlier in the configuration. I have it goi to the baseHref since there’s no PageNotFound component behavior. So if you go to /foo this’ll just send you back to /.

Copy link
Member

patrick-fs left a comment

LGTM! I left a question in the comments about about the router.

@van-fs van-fs merged commit c8418b4 into master Mar 11, 2020
@van-fs van-fs deleted the van/init-components branch Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.