diff --git a/bower.json b/bower.json index 5ce84f3..2d6fe40 100644 --- a/bower.json +++ b/bower.json @@ -1,14 +1,13 @@ { "name": "angularUtils", "version": "0.0.0", - "homepage": "https://github.com/michaelbromley/angularUtils", + "homepage": "https://github.com/nielsboogaard/angularUtils", "authors": [ "Michael Bromley " ], "description": "A collection of AngularJS utilities", "main": "src/angularUtils.js", "license": "MIT", - "private": true, "ignore": [ "**/.*", "node_modules", diff --git a/src/directives/uiBreadcrumbs/README.md b/src/directives/uiBreadcrumbs/README.md index 3f78503..06673ad 100644 --- a/src/directives/uiBreadcrumbs/README.md +++ b/src/directives/uiBreadcrumbs/README.md @@ -30,7 +30,8 @@ Assuming you already have your app configured to use ui-router, you then need to ```HTML + [abstract-proxy-property=""] + [include-state-data=""] ``` @@ -39,6 +40,7 @@ route's breadcrumb. If none is specified, or if the specified property is not fo * **`template-url`** (optional) Use this attribute to specify the URL of the `uiBreadcrumbs.tpl.html` file. Alternatively this may be configured in the JavaScript file itself, in which case this attribute would not be needed. * **`abstract-proxy-property`** (optional) Used when working with abstract states. See the section on working with abstract states below for a full explanation. +* **`include-state-data`** (optional) If true is specified, the data property of the state will be added to the breadcrumb to be able to implement additional checks based on that on your custom template file. ## Example setup diff --git a/src/directives/uiBreadcrumbs/uiBreadcrumbs.js b/src/directives/uiBreadcrumbs/uiBreadcrumbs.js index de7ab7e..d4dadc8 100644 --- a/src/directives/uiBreadcrumbs/uiBreadcrumbs.js +++ b/src/directives/uiBreadcrumbs/uiBreadcrumbs.js @@ -34,7 +34,8 @@ }, scope: { displaynameProperty: '@', - abstractProxyProperty: '@?' + abstractProxyProperty: '@?', + includeStateData: '@?' }, link: function(scope) { scope.breadcrumbs = []; @@ -61,10 +62,14 @@ displayName = getDisplayName(workingState); if (displayName !== false && !stateAlreadyInBreadcrumbs(workingState, breadcrumbs)) { - breadcrumbs.push({ + var breadcrumb = { displayName: displayName, route: workingState.name - }); + }; + if (scope.includeStateData === 'true') { + breadcrumb['data'] = workingState.data; + } + breadcrumbs.push(breadcrumb); } } currentState = currentState.parent;