Angular Gantt入门没有加载'gantt'模块

时间:2016-08-10 19:09:48

标签: angularjs

当我尝试在模块中加载甘特图时,我得到一个$ injector:moduleer错误意味着它加载有问题。我也在使用Laravel。

在我的script.js文件中

var myApp = angular.module('myApp', ['gantt']); //error here
myApp.controller("appController", function($scope) {

$scope.data = [
        {
            name: 'row1',
            tasks : [
                {name: 'task1', from: 1470854811, to:  1470941211 },
                {name: 'task2', from: 1470854811, to:  1470941211 }
            ]
        },
        {
            name: 'row2', 
            tasks: [
                {name: 'task3', from: 1470854811, to:  1470941211},
                {name: 'task4', from: 1470854811, to:  1470941211}
              ]
        }
    ];
});

Lavarel gulpfile.js,我已经确认了我希望加载的内容正在加载

elixir(function(mix) {
    mix.copy('resources/assets/bower/angular-gantt/assets/angular-gantt.css', 'public/css/angular-gantt.css');
    mix.copy('resources/assets/bower/angular-gantt/assets/angular-gantt-plugins.css', 'public/css/angular-gantt-plugins.css');
    mix.sass('style.scss');


    //defaults to resources/assets/js
    mix.scripts([
        '../bower/angular/angular.min.js',
        '../bower/angular-gantt/assets/angular-gantt.js',
        '../bower/angular-gantt/assets/angular-gantt-plugins.js',
        '*.js' //this will load my script.js
    ]);

});

我的资源/视图中的index.php

 <body ng-app="myApp" ng-controller="appController" >
    <div gantt data=data>

    </div>
</body>

我正试图得到我的问候世界

1 个答案:

答案 0 :(得分:0)

您可能需要将“angular-momentjs”:“^ 0.2.2”导入项目中。要使用给定的日期范围构建甘特图,momentjs库用于处理日期范围。

.some()

Angular-momentjs是角度项目的momentjs库的含义。