From 743b2a068745a82401bc418d3d45521f5a7b4b3a Mon Sep 17 00:00:00 2001 From: onkeltem Date: Mon, 14 Dec 2015 07:14:18 +0300 Subject: [PATCH 1/2] Add ability to cut the parents chain off --- src/angular-breadcrumb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angular-breadcrumb.js b/src/angular-breadcrumb.js index a8f1415..7c410fa 100644 --- a/src/angular-breadcrumb.js +++ b/src/angular-breadcrumb.js @@ -88,7 +88,7 @@ function $Breadcrumb() { // Handle the "parent" property of the breadcrumb, override the parent/child relation of the state var isFunction = typeof conf.ncyBreadcrumb.parent === 'function'; var parentStateRef = isFunction ? conf.ncyBreadcrumb.parent($lastViewScope) : conf.ncyBreadcrumb.parent; - if(parentStateRef) { + if(parentStateRef || parentStateRef === false) { return parentStateRef; } } From 0467f6ade796f972e5134dd25ea473917436bd10 Mon Sep 17 00:00:00 2001 From: onkeltem Date: Mon, 14 Dec 2015 08:46:56 +0300 Subject: [PATCH 2/2] Check if the parent property is defined --- src/angular-breadcrumb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angular-breadcrumb.js b/src/angular-breadcrumb.js index 7c410fa..58ea6a5 100644 --- a/src/angular-breadcrumb.js +++ b/src/angular-breadcrumb.js @@ -84,7 +84,7 @@ function $Breadcrumb() { var ref = parseStateRef(stateRef), conf = $state.get(ref.state); - if(conf.ncyBreadcrumb && conf.ncyBreadcrumb.parent) { + if(conf.ncyBreadcrumb && typeof conf.ncyBreadcrumb.parent !== 'undefined') { // Handle the "parent" property of the breadcrumb, override the parent/child relation of the state var isFunction = typeof conf.ncyBreadcrumb.parent === 'function'; var parentStateRef = isFunction ? conf.ncyBreadcrumb.parent($lastViewScope) : conf.ncyBreadcrumb.parent;