abhi
abhi

Reputation: 2148

ngMaterial throwing Error: [$injector:modulerr]

I am using ngMateril for custom dialog. But I am getting error as Error: [$injector:modulerr]. I am not able to figure out the error. Any help would be appreciated.

External scripts in my HTML code

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script>
(function () {
    'use strict';

    angular
        .module('app', ['ui.router'],['ngMaterial'])
        .config(config)
        .run(run);

    function config($stateProvider, $urlRouterProvider)   {
        // default route
        $urlRouterProvider.otherwise("/");

        $stateProvider
            .state('home', {
                url: '/',
                templateUrl: 'home/index.html',
                controller: 'Home.IndexController',
                controllerAs: 'vm',
                data: { activeTab: 'home' }
            })
            .state('account', {
                url: '/account',
                templateUrl: 'account/index.html',
                controller: 'Account.IndexController',
                controllerAs: 'vm',
                data: { activeTab: 'account' }
            });
    }
 })();
enter image description here

Upvotes: 0

Views: 436

Answers (2)

Sajeetharan
Sajeetharan

Reputation: 222582

Order of dependencies should be separated by comma,

.module('app', ['ui.router', 'ngMaterial'])

Also you are missing the references for ng-area and ng-animate. Check the following answer

angular material design ui router not working

Upvotes: 1

Mathew Berg
Mathew Berg

Reputation: 28750

You need to configure your module slightly differently:

.module('app', ['ui.router', 'ngMaterial'])

Upvotes: 1

Related Questions