Skip to content

Commit

Permalink
feat: minimal app
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam committed Mar 28, 2024
1 parent b3d7d82 commit 35f6542
Show file tree
Hide file tree
Showing 30 changed files with 139 additions and 1,132 deletions.
15 changes: 14 additions & 1 deletion apps/minimal/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
<h1>Welcome minimal</h1>
<h1>xng-breadcrumb</h1>
<h2>Angular version {{ name }}</h2>

<div *ngIf="showBreadcrumbs">
<xng-breadcrumb class="auto-generated-true"></xng-breadcrumb>

<h3>Auto generated: false</h3>
<xng-breadcrumb [autoGenerate]="false" class="auto-generated-false"></xng-breadcrumb>
</div>

<router-outlet></router-outlet>

<button (click)="toggleBreadcrumbVisibility()">Toggle Breadcrumb Visibility</button>

<button (click)="setOrderItemsLabel()">Set Order Items Label</button>
26 changes: 22 additions & 4 deletions apps/minimal/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { Component, VERSION } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { BreadcrumbComponent, BreadcrumbItemDirective, BreadcrumbService } from 'xng-breadcrumb';

@Component({
standalone: true,
imports: [RouterModule],
imports: [RouterModule, BreadcrumbComponent, BreadcrumbItemDirective, CommonModule],
selector: 'app-root',
templateUrl: './app.component.html',
styles: ``,
})
export class AppComponent {}
export class AppComponent {
showBreadcrumbs = false;

constructor(router: Router, private breadcrumbService: BreadcrumbService) {
router.routeReuseStrategy.shouldReuseRoute = () => false;
}

toggleBreadcrumbVisibility() {
this.showBreadcrumbs = !this.showBreadcrumbs;
}

setOrderItemsLabel() {
this.breadcrumbService.set('@orderItems', { label: 'My Order Items' });
}

name = 'Angular ' + VERSION.major;
}
63 changes: 62 additions & 1 deletion apps/minimal/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
import { Route } from '@angular/router';
import { PageComponent } from './page/page.component';

export const appRoutes: Route[] = [];
export const appRoutes: Route[] = [
{
path: '',
redirectTo: 'homepage',
pathMatch: 'full',
},
{
path: 'homepage',
component: PageComponent,
data: {
breadcrumb: 'Dashboard',
},
},
{
path: 'company',
data: { breadcrumb: 'Companies' },
children: [
{ path: '', component: PageComponent },
{
path: ':companyId',
data: { breadcrumb: 'Company Name' },
children: [
{ path: '', component: PageComponent },
{
path: 'order',
data: { breadcrumb: 'Orders' },
children: [
{ path: '', component: PageComponent },
{
path: ':orderId',
data: { breadcrumb: 'Order Details' },
children: [
{ path: '', component: PageComponent },
{
path: 'items',
component: PageComponent,
data: {
breadcrumb: {
alias: 'orderItems',
},
},
},
{
path: 'payment',
component: PageComponent,
data: { breadcrumb: 'Payment Info' },
},
{
path: 'delivery',
component: PageComponent,
data: { breadcrumb: 'Delivery Details' },
},
],
},
],
},
],
},
],
},
];
30 changes: 30 additions & 0 deletions apps/minimal/src/app/page/page.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<ul>
<li>
<a [routerLink]="['/company']"> Company list </a>
<ul>
<li>
<a [routerLink]="['/company/1']"> Company </a>
<ul></ul>
</li>
<li>
<a [routerLink]="['/company/1/order']"> Order list </a>
<ul>
<li>
<a [routerLink]="['/company/1/order/2']"> Order Details </a>
<ul>
<li>
<a [routerLink]="['/company/1/order/2/items']"> Order Items </a>
</li>
<li>
<a [routerLink]="['/company/1/order/2/payment']"> Order Payment Info </a>
</li>
<li>
<a [routerLink]="['/company/1/order/2/delivery']"> Order Delivery Info </a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
10 changes: 10 additions & 0 deletions apps/minimal/src/app/page/page.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { RouterLink } from '@angular/router';

@Component({
selector: 'app-page',
templateUrl: './page.component.html',
standalone: true,
imports: [RouterLink],
})
export class PageComponent {}
2 changes: 1 addition & 1 deletion apps/minimal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"useDefineForClassFields": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strict": false,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
Expand Down
22 changes: 0 additions & 22 deletions apps/ssr-e2e/.eslintrc.json

This file was deleted.

69 changes: 0 additions & 69 deletions apps/ssr-e2e/playwright.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/ssr-e2e/project.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ssr-e2e/src/example.spec.ts

This file was deleted.

25 changes: 0 additions & 25 deletions apps/ssr-e2e/tsconfig.json

This file was deleted.

33 changes: 0 additions & 33 deletions apps/ssr/.eslintrc.json

This file was deleted.

22 changes: 0 additions & 22 deletions apps/ssr/jest.config.ts

This file was deleted.

Loading

0 comments on commit 35f6542

Please sign in to comment.