2
votes

I used yeoman to generate an angularjs project. I want to use ng-breadcrumbs so I installed it and when I try to add angular.module('ab', ['ngRoute', 'ng-breadcrumbs']) I have an error Failed to instantiate module ng-breadcrumbs due to: [$injector:nomod] Module 'ng-breadcrumbs' is not available! You either misspelled the module name or forgot to load it. I guess I have to load the js file but where ? I don't understand where yeoman do that ? I can't find any loaded file . Shall I just do it in root.html ? or index.html ? Other question, I am suing angular ui router, it works with ng-breadcrumbs too or I have to use ngRoute ? I can't find script src="angular.js" in any file

2

2 Answers

2
votes

Include ng-breadcrumbs.min.js after including angular.min.js in your index.html.

If you are planning to use ngRoute, you have to include angular-route.js. Dependency injection would be angular.module('yourApp', ['ngRoute']);

If you are using UI Router, you have to include angular-ui-router.min.js. Dependency injection would be angular.module('yourApp', ['ui.router']);

ng-breadcrumbs could be used with ng-route as presented here

0
votes

In index.html right after script src="angular.js" you have to add ng-breadcrumbs javascript source.

You can install it via

bower install ng-breadcrumbs --save

then add to index.html

<script src="bower_components/ng-breadcrumbs/dist/ng-breadcrumbs.min.js">