mean.js中的角带问题

时间:2014-12-17 13:42:30

标签: angularjs angular-strap meanjs

我有Mean.js架构,我需要制作一些模态窗口。但是,当我加入['ngAnimate', 'mgcrea.ngStrap']时,我遇到了这个问题:

Uncaught Error: [$injector:nomod] Module 'undefined' 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.

我已经加入了角带组件:

all.js

            js: [
            'public/lib/angular/angular.js',
            'public/lib/angular-resource/angular-resource.js', 
            'public/lib/angular-cookies/angular-cookies.js', 
            'public/lib/angular-animate/angular-animate.js', 
            'public/lib/angular-touch/angular-touch.js', 
            'public/lib/angular-sanitize/angular-sanitize.js', 
            'public/lib/angular-ui-router/release/angular-ui-router.js',
            'public/lib/angular-ui-utils/ui-utils.js',
            'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
            'public/lib/angular-strap/dist/angular-strap.min.js', 
            'public/lib/angular-strap/dist/angular-strap.tpl.min.js', 
            'public/lib/angular-strap/dist/modules/modal.min.js', 
            'public/lib/angular-strap/dist/modules/modal.tpl.min.js',
            'public/lib/angular-animate/angular-animate.min.js',
            'public/lib/lodash/dist/lodash.js',

        ]

controller.js:

    'use strict';
angular.module('angular-strap' ['ngAnimate', 'mgcrea.ngStrap']).controller('AngularStrapController', ['$scope',
    function($scope) {
        $scope.modal = {
            "title": "Title",
            "content": "Hello Modal<br />This is a multiline message!"
        }
    }
])

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

您在angular-strap

之后错过了一个逗号

正确: angular.module('angular-strap' , ['ngAnimate', 'mgcrea.ngStrap'])