Skip to content

Commit 0e05fc6

Browse files
committed
Convert demo/cart to standalone
1 parent 89b9f06 commit 0e05fc6

57 files changed

Lines changed: 185 additions & 488 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/demo/src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const appRoutes: Routes = [
2525
{
2626
path: '', component: TemplateComponent, children: [
2727
{ path: 'product-grid', component: ProductGridViewComponent },
28-
{ path: 'cart', loadChildren: () => import('./cart/cart.module').then(m => m.DemoCartModule) },
28+
{ path: 'cart', loadChildren: () => import('./cart/cart.routes').then(m => m.demoCartRoutes) },
2929
{
3030
path: 'product/:id',
3131
component: ProductViewComponent,

apps/demo/src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { DaffPaymentStateModule } from '@daffodil/payment/state';
2222

2323
import { AppRoutingModule } from './app-routing.module';
2424
import { AppComponent } from './app.component';
25-
import { DemoCartRootModule } from './cart/cart-root.module';
2625
import { CategoryModule } from './category/category.module';
2726
import { DemoCheckoutStepActionTypes } from './checkout/actions/checkout-step.actions';
2827
import { TemplateModule } from './core/template/template/template.module';
@@ -51,7 +50,6 @@ import { environment } from '../environments/environment';
5150

5251
AppRoutingModule,
5352
DemoRoutingComponentModule,
54-
DemoCartRootModule,
5553
ProductModule,
5654
CategoryModule,
5755
TemplateModule,

apps/demo/src/app/cart/cart-root.module.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { importProvidersFrom } from '@angular/core';
2+
3+
import { DaffCartStateModule } from '@daffodil/cart/state';
4+
5+
import { provideAddToCartNotificationState } from './components/add-to-cart-notification/add-to-cart-notification-state.provider';
6+
7+
export function provideCartRoot() {
8+
return [
9+
importProvidersFrom(DaffCartStateModule),
10+
provideAddToCartNotificationState(),
11+
];
12+
}

apps/demo/src/app/cart/cart-routing.module.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/demo/src/app/cart/cart.module.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Routes } from '@angular/router';
2+
3+
import { provideCartRoot } from './cart-root.provider';
4+
import { DemoCartViewComponent } from './pages/cart-view/cart-view.component';
5+
6+
export const demoCartRoutes: Routes = [
7+
{
8+
path: '',
9+
pathMatch: 'full',
10+
providers: [provideCartRoot()],
11+
component: DemoCartViewComponent,
12+
},
13+
];

apps/demo/src/app/cart/components/add-to-cart-notification/add-to-cart-notification-state.module.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { importProvidersFrom } from '@angular/core';
2+
import { EffectsModule } from '@ngrx/effects';
3+
import { StoreModule } from '@ngrx/store';
4+
5+
import { DaffModalModule } from '@daffodil/design/modal';
6+
7+
import { AddToCartNotificationEffects } from './effects/add-to-cart-notification.effects';
8+
import { reducers } from './reducers/index';
9+
10+
export function provideAddToCartNotificationState() {
11+
return [
12+
importProvidersFrom(
13+
DaffModalModule,
14+
StoreModule.forFeature('demoAddToCartNotification', reducers),
15+
EffectsModule.forFeature([AddToCartNotificationEffects]),
16+
),
17+
];
18+
}

apps/demo/src/app/cart/components/add-to-cart-notification/add-to-cart-notification.module.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)