# Breadcrumbs-service
Adding breadcrumbs to current place on page


### Usage


import component & service from node_module

```
import {BreadcrumbsService} from 'epom-ng2-ui-foundation';
```

add **BreadcrumbsService** to providers[] in your module

```
providers: [
    BreadcrumbsService
]
```


## Service public methods
| Method Declaration                                                      | Description |
| ----------------------------------------------------------------------- | ----------- |
| setBreadcrumbs(newBreadcrumbs: Array<{link?: string, title: string, queryParams?: {[key: string]: string}}>): void | Setting breadcrumbs. argument is an array of objects. Single object - single breadcrumb; from left to right, param "link" is not necessary, queryParams - for GET params in breadcrumb link |
|getBreadcrumbs(): Array<{link?: string, title: string}> | Returns array of current breadcrumbs


Examples:
```javascript
    this.breadcrumbs.setBreadcrumbs([
  {link: '/dashboard', title: 'Dashboard'},
  {title: 'Final level of breadcrumbs}
]);
```


## Module Examples

```javascript
import {BreadcrumbsService} from 'epom-ng2-breadcrumbs/breadcrumbs.service';
export class SomeComponent {
  constructor(private breadcrumbs: BreadcrumbsService) {
  this.breadcrumbs.setBreadcrumbs([
                                    {link: '/dashboard', title: 'Dashboard'},
                                    {title: 'Final level of breadcrumbs}
                                  ]);
}
}
```
