Skip to content

Getting started

ncuillery edited this page Oct 29, 2014 · 8 revisions

Installation

angular-breadcrumb requires ui-router in minimal version 0.2.0 (when the method $state.get was added).

Download the production version or the development version.

Or download it with bower : open a terminal and run

bower install angular-breadcrumb

Include the js your web page:

<script src="[...]angular-breadcrumb[.min].js"></script>

Add dependency to your app module:

'ncy-angular-breadcrumb'

The module is now installed. It exposes the $breadcrumb service and the ncy-breadcrumb directive.

Configuration

Configure the ui-router (see the ui-router project).

Define a ncyBreadcrumb.label property to each states

$stateProvider.state('home', {
  url: '/home',
  templateUrl: 'views/home.html',
  controller: 'HomeCtrl',
  ncyBreadcrumb: {
    label: 'Home page'
  }
})

Activation

Use the directive ncy-breadcrumb

<div ncy-breadcrumb></div>

Let the magic begin !

See the API reference page for all the configuration options :

Clone this wiki locally