Skip to content

Commit

Permalink
feat(app): remove code block components and service as they are less …
Browse files Browse the repository at this point in the history
…useful
  • Loading branch information
udayvunnam committed Feb 23, 2020
1 parent 9260643 commit b7d647f
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 299 deletions.
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,6 @@

> A lightweight, declarative and configurable breadcrumbs solution for Angular 6 and beyond. https://www.npmjs.com/package/xng-breadcrumb
- [About](#about)
- [Demo](#demo)
- [Features](#features)
- [Quickstart](#quickstart)
- [Setup Guide](#setup-guide)

- [Map Breadcrumb labels to Routes in Route Config](#Map-Breadcrumb-labels-to-Routes-in-Route-Config)
- [Update labels dynamically](#Update-labels-dynamically)
- [Skip Breadcrumbs for certain routes](#Skip-Breadcrumbs-for-certain-routes)

- [Customization](#customization)

- [Custom Breadcrumb template (add icons, change text, add i18n ability, etc)](<#Custom-Breadcrumb-template-(add-icons,-change-text,-add-i18n-ability,-etc)>)
- [Custom separator](#custom-separator)
- [Custom Breadcrumb Styles](#custom-breadcrumb-styles)
- [Disable Auto Generation of breadcrumb labels](#disable-auto-generation-of-breadcrumb-labels)

- [API](#api)

- [Route Config](#route-config)
- [xng-breadcrumb](#xng-breadcrumb)
- [BreadcrumbService.set(pathOrAlias, breadcrumb)](<#BreadcrumbService.set(pathOrAlias,-breadcrumb)>)

## About

- In applications with deep navigation hierarchy, it is essential to have breadcrumbs.
Expand Down
5 changes: 4 additions & 1 deletion projects/xng-breadcrumb-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const appRoutes: Routes = [
path: 'dashboard',
loadChildren: './dashboard/dashboard.module#DashboardModule',
data: {
breadcrumb: 'my dashboard'
breadcrumb: {
label: 'my dashboard',
info: 'dashboard'
}
}
},
{
Expand Down
53 changes: 34 additions & 19 deletions projects/xng-breadcrumb-app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
<div class="app-container mat-app-background" [ngClass]="{ 'xng-dark-theme': darkMode }">
<app-navbar (themeChanged)="updateTheme($event)"></app-navbar>
<section class="route-container" fxLayout="column" fxLayoutGap="16px">
<xng-breadcrumb></xng-breadcrumb>
<div>
<label for="default">Default breadcrumbs </label>
<xng-breadcrumb id="default"></xng-breadcrumb>
</div>

<xng-breadcrumb separator=">>">
<ng-container *xngBreadcrumbItem="let breadcrumb">
{{ breadcrumb | titlecase }}
</ng-container>
</xng-breadcrumb>
<div>
<label for="titleCase">Titlecase and custom seperator </label>
<xng-breadcrumb separator=">>" id="titleCase">
<ng-container *xngBreadcrumbItem="let breadcrumb">
{{ breadcrumb | titlecase }}
</ng-container>
</xng-breadcrumb>
</div>

<xng-breadcrumb [separator]="separatorTemplate"></xng-breadcrumb>
<div>
<label for="materialIcon">Material icon as seperator </label>
<xng-breadcrumb [separator]="separatorTemplate" id="materialIcon"></xng-breadcrumb>
</div>

<xng-breadcrumb [separator]="separatorTemplate" class="myapp-breadcrumb">
<ng-container *xngBreadcrumbItem="let breadcrumb; let info = info; let first = first">
<mat-icon *ngIf="info">{{ info }}</mat-icon>
<ng-container>{{ breadcrumb | titlecase }}</ng-container>
</ng-container>
</xng-breadcrumb>
<div>
<label for="advancedTemplate1">Advanced template1 </label>
<xng-breadcrumb [separator]="separatorTemplate" class="myapp-breadcrumb" id="advancedTemplate1">
<ng-container *xngBreadcrumbItem="let breadcrumb; let info = info; let first = first">
<mat-icon *ngIf="info">{{ info }}</mat-icon>
<ng-container>{{ breadcrumb | titlecase }}</ng-container>
</ng-container>
</xng-breadcrumb>
</div>

<xng-breadcrumb [separator]="separatorTemplate" class="myapp-breadcrumb">
<ng-container *xngBreadcrumbItem="let breadcrumb; let info = info; let first = first">
<mat-icon *ngIf="info && first">{{ info }}</mat-icon>
<ng-container *ngIf="!first">{{ breadcrumb | titlecase }}</ng-container>
</ng-container>
</xng-breadcrumb>
<div>
<label for="advancedTemplate2">Advanced template2 </label>
<xng-breadcrumb [separator]="separatorTemplate" class="myapp-breadcrumb" id="advancedTemplate2">
<ng-container *xngBreadcrumbItem="let breadcrumb; let info = info; let first = first">
<mat-icon *ngIf="info">{{ info }}</mat-icon>
<ng-container *ngIf="!first">{{ breadcrumb | titlecase }}</ng-container>
</ng-container>
</xng-breadcrumb>
</div>

<router-outlet></router-outlet>
</section>
Expand Down
14 changes: 14 additions & 0 deletions projects/xng-breadcrumb-app/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@

.route-container {
padding: 16px;

div {
display: flex;
flex-direction: row;
align-items: center;
label {
min-width: 240px;
}
}
}

@media (max-width: 960px) {
.app-container {
padding-top: 112px;
min-height: calc(100% - 112px);
}

.route-container div {
flex-direction: column;
align-items: start;
}
}
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
<app-code-block [code]="code"></app-code-block>
37 changes: 0 additions & 37 deletions projects/xng-breadcrumb-app/src/app/core/code-block.service.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
<app-code-block [code]="code"></app-code-block>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<form [formGroup]="menteeFG" (submit)="addMentee()">
<mat-card>
<section fxLayout="row" fxLayoutAlign="stretch center" fxLayoutGap="32px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<section *ngIf="mentee">
<mat-card>
<mat-card-header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<form [formGroup]="menteeFG" (submit)="updateMentee()" *ngIf="menteeFG">
<mat-card>
<section fxLayout="row" fxLayoutAlign="stretch center" fxLayoutGap="32px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<section class="add-item">
<a mat-fab routerLink="add" color="accent" routerLink="add">
<mat-icon matTooltip="Add a Mentee">add</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<form [formGroup]="mentorFG" (submit)="addMentor()">
<mat-card>
<section fxLayout="row" fxLayoutAlign="stretch center" fxLayoutGap="32px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<section *ngIf="mentor">
<mat-card>
<mat-card-header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<form [formGroup]="mentorFG" (submit)="updateMentor()" *ngIf="mentorFG">
<mat-card>
<section fxLayout="row" fxLayoutAlign="stretch center" fxLayoutGap="32px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<app-code-block [code]="code"></app-code-block>

<section class="add-item">
<a mat-fab routerLink="add" color="accent" routerLink="add">
<mat-icon matTooltip="Add a Mentor">add</mat-icon>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b7d647f

Please sign in to comment.