angular-crumbs

AngularJS Factory Module which generates a breadcrumb trail for your current route.

Added by: Sam Deering

GitHub

Repository

yeojz/angular-crumbs

Stats

Stars: 0

Watchers: 0

Forks: 0

Author

Gerald Yeo
Gerald Yeo

Module Description

angular-crumbs

Angular-crumbs is a factory module for AngularJS which generates a breadcrumb trail for your current route.

Usage

We use bower for dependency management. Add

dependencies: {
    "angular-crumbs"": "latest"
}

To your bower.json file. Then run

bower install

This will copy the ui-date files into your components folder, along with its dependencies.

Alternatively you can run

bower install angular-crumbs --save

Load the script files in your application:

<script type="text/javascript" src="components/angular-crumbs/dist/angular-crumbs.min.js"></script>

Add the date module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['angularCrumbs'])

Example BreadCrumb Factory usage:

'use strict';

angular.module('MyApp')
.controller('ExampleController', 
['$scope', '$rootScope', 'BreadcrumbsFactory',
function ($scope, $rootScope, BreadcrumbsFactory) {

    $scope.breadcrumbs = BreadcrumbsFactory.get();

}]);

Example HTML:

<ul ng-controller="BreadcrumbsController">
    <li ng-repeat="crumbs in breadcrumbs">
        <ng-switch on="$last">
            <span ng-switch-when="true">{{crumbs.title}}</span>
            <span ng-switch-default><a href="{{crumbs.path}}">{{crumbs.title}}</a></span>
        </ng-switch>
    </li>
</ul>

Module stats last updated: 2015-04-19 02:59:20

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!