2

I am planing to implement angular material design with my application. i have included the material.js and material.css and the app definition goes as follows, here is the code,

Index.html:

 <script src="js/ripples.js"></script>
 <script src="js/material.js"></script>

app.js ar routerApp = angular.module('DiginRt', ['ui.bootstrap','SimpleCouch','ngMaterial']);

When i start to run the application, it says

 Uncaught Error: [$injector:modulerr] Failed to instantiate module DiginRt due to:
Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to:
Error: [$injector:nomod] Module 'ngMaterial' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
2
  • where do you put the angular.js reference, before or after material.js? Commented Feb 10, 2015 at 5:38
  • you'd better create a jsfiddler/plnkr.co/codpen demo app for better troubleshooting. Commented Feb 10, 2015 at 5:42

2 Answers 2

6

I have created my angular material design project using this sequential injection, hope it helps,

  <script src="bower_components/angular/angular.js"></script>
  <script src="bower_components/angular-animate/angular-animate.js"></script>
  <script src="bower_components/angular-route/angular-route.js"></script>

  <script src="bower_components/angular-aria/angular-aria.js"></script>
  <script src="bower_components/hammerjs/hammer.js"></script>
  <script src="bower_components/angular-material/angular-material.js"></script>
...  
  <script src="app.js"></script>

Btw, did you install it using bower install angular-material --save?

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

Comments

2

The error is saying that it cannot find a dependency. It's likely you included your scripts in the wrong order. Make sure the app.js is included last. Without seeing a code example I cannot be any more specific than that. As @rebornix said, a jsfiddle or Plunker would be very helpful.

Comments

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.