Guest User

Breadcrumb Service

a guest
Sep 8th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.factory('Breadcrumb', function(){
  2.     var _items = [{
  3.         title: 'Home',
  4.         href: '/'
  5.     }];
  6.     return {
  7.         items: function(){
  8.             return _items;
  9.         },
  10.         add: function(name, link){
  11.             _items.push({
  12.                 title: name,
  13.                 href: link
  14.             });
  15.         },
  16.  
  17.         reset: function(){
  18.             _items = [{
  19.                 title: 'Home',
  20.                 link: '/'
  21.             }];
  22.         }
  23.     };
  24. });
Advertisement
Add Comment
Please, Sign In to add comment