From f11980ece279a215a8b2d702c90f6a1e1acd54a0 Mon Sep 17 00:00:00 2001 From: Uday Vunnam Date: Tue, 5 Nov 2019 22:58:19 +0530 Subject: [PATCH] feat: custom separator icon, custom template and i18n BREAKING CHANGE: Modified API for component and service. --- .../xng-breadcrumb/src/lib/auto-label.pipe.ts | 15 ++++ .../src/lib/breadcrumb.component.html | 6 +- .../src/lib/breadcrumb.component.ts | 14 +++- .../src/lib/breadcrumb.module.ts | 3 +- .../src/lib/breadcrumb.service.ts | 74 +++++++++++-------- projects/xng-breadcrumb/src/lib/breadcrumb.ts | 5 ++ 6 files changed, 77 insertions(+), 40 deletions(-) create mode 100644 projects/xng-breadcrumb/src/lib/auto-label.pipe.ts diff --git a/projects/xng-breadcrumb/src/lib/auto-label.pipe.ts b/projects/xng-breadcrumb/src/lib/auto-label.pipe.ts new file mode 100644 index 0000000..b3cfbe0 --- /dev/null +++ b/projects/xng-breadcrumb/src/lib/auto-label.pipe.ts @@ -0,0 +1,15 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'autoLabel' +}) +export class AutoLabelPipe implements PipeTransform { + transform(breadcrumbList: any, shouldautoGenerate: boolean, ...args: any[]): any { + if (shouldautoGenerate) { + return breadcrumbList; + } else { + return breadcrumbList.filter(breadcrumb => !breadcrumb.isAutoGeneratedLabel); + } + return null; + } +} diff --git a/projects/xng-breadcrumb/src/lib/breadcrumb.component.html b/projects/xng-breadcrumb/src/lib/breadcrumb.component.html index 4bc589b..4b4d5a2 100644 --- a/projects/xng-breadcrumb/src/lib/breadcrumb.component.html +++ b/projects/xng-breadcrumb/src/lib/breadcrumb.component.html @@ -1,6 +1,6 @@ -