角传送带模块加载失败 [英] Angular-Carousel Module fails to load

查看:183
本文介绍了角传送带模块加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试实现图像画廊角旋转木马在我的网站。但角度抛出一个错误,旋转木马加载时:

I´m trying to implement the image gallery "angular-carousel" on my site. But Angular throws an error, when loading carousel:

未捕获的错误:[$喷油器:modulerr]的http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&p1=Error%3A%…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A381)

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&p1=Error%3A%…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A381)

我在节点和Ex preSS运行,我用了一个CDN源的角旋转木马:

I'm running on Node and Express and I used a CDN Source for angular-carousel:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-carousel/0.3.12/angular-carousel.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-carousel/0.3.12/angular-carousel.js"></script> 

这就是我倒是想放置传送带:

This is where I´d like to place the carousel:

<ul rn-carousel class="image">
    <li ng-repeat="x in img">
        <img ng-src="/uploads/{{project._id}}/{{x}}"/>
    </li>
</ul>

和here's我的控制器部分:

And here´s my Controller part:

var app = angular.module('myApp', ['ngRoute', 'angular-carousel']);
    app.controller('ProjectController',  function($scope,$http){
        var url = window.location.pathname;
        var id = url.substring(url.lastIndexOf('/') + 1);
        $http.get('/projects_view/'+id).success(function(data){ 
            $scope.project = data;
        });
        $http.get('/getpics/'+id).success(function (files){
            $scope.img = files;             
        });         
    });

无转盘图像加载完美的作品。
希望帮助:)

Without carousel image loading works perfectly. Hoping for help :)

推荐答案

您,因为在创建角旋转木马错过了角touch.js 模块,它需要 NG-触摸的依赖,这是在创建一个为什么角旋转木马模块它搜索 ngTouch 模块。且不可有,所以角抛出一个 $喷油器/ modulerr 错误。

You missed to angular-touch.js because while creating angular-carousel module it needs ng-touch dependency, That's why while creating a angular-carousel module it search for ngTouch module. And which is not available there, So angular throws an $injector/modulerr error.

code

angular.module('angular-carousel', [
    'ngTouch',
    'angular-carousel.shifty'
]);

以上code < STRONG>点击这里 角carousel.js API。

这篇关于角传送带模块加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆