Search code examples
angularjsangularjs-material

mdThemingProvider Angular Material Error


I can't figure out why $mdThemingProvider crashes.

var app = angular.module( 'aBMain',['ngMaterial']);
  console.log('3');

app.config(function($mdThemingProvider){
  console.log('4');

  $mdThemingProvider.theme('default')
    .primaryPalette('pink')
    .accentPalette('orange');

});

Codepen : http://codepen.io/turcuciprian/pen/mPwBOm check out the console. It's supposed to output 4, why does it hang here? (with an error. What am I missing?


Solution

  • You are missing two references:

    1. angular-animate.js (or angular-animate.min.js) CDN
    2. angular-aria.js (or angular-aria.min.js) CDN

    Always debug with the non-minified versions. As soon as I changed your Codepen to use the non-minified versions the exact reason for the error was spelled out in the console.