2

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

0

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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">

1 Comment

there is no script src="angular.js" in any file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.