ikismail / Angular-ShoppingCart

ShoppingCart (Ecommerce) 🛒 Application using Angular10, Firebase, PWA, Drag&Drop, Materialized Bootstrap and i18n 🚀🔥👨‍💻
https://angular-shoppingcart.firebaseapp.com/
MIT License
621 stars 387 forks source link

Why 'My Account/Your carts' link not working? #42

Closed will-hu-0 closed 5 years ago

will-hu-0 commented 5 years ago

Hi.. It seems that the link for 'My Account/Your cart' and 'My Account /Your wishlist' does not work...

Code looks

        <li class="list-group-item hoverable">
          <a [routerLink]="['/users', {outlets: {'profileOutlet': ['cart-items']}}]">Your Cart</a>
        </li>

...
 <router-outlet name="profileOutlet"></router-outlet>

It supposes to show cart into profileOutlet I suppose.

Thanks.

will-hu-0 commented 5 years ago

Oh.. I know how to fix it.. By adding something below into user.routing.ts

import { CartProductsComponent} from "../product/cart-products/cart-products.component";
export const UserRoutes: Routes = [
    {
        path: 'users',
        component: UserComponent,
        canActivate: [ AuthGuard ],
        children: [
            {
                path: '',
                component: UserAccountComponent,
                outlet: 'profileOutlet'
            },
            {
                path: 'cart-items',
                component: CartProductsComponent,
                outlet: 'profileOutlet'
            }
        ]
    }
];