【问题标题】:ng-repeate images, an empty image not found, why?ng-repeat images,找不到空图像,为什么?
【发布时间】:2014-01-29 11:45:55
【问题描述】:

我有一个图像列表,如果我使用 ng-repeat,则会出现 jQuery 错误
GET http:// SOME IP :8001/%7B%7Bimage%7D%7D 404 (NOT FOUND)
似乎 ng-repeate 创建了一个空图像?但是在 console.log 中没有空条目...

控制器:

appControllers.controller('remindersCtrl', ['$scope', '$http',
function($scope, $http){
    console.log("reminders controller heyo");

    var staticImgPath = "static/img/pages/reminders/"
    $scope.reminderWastesTypes = [
        staticImgPath + 'Biolski-odpadki.png',
        staticImgPath + 'Embalaza.png',
        staticImgPath + 'Ostali-odpadki.png',
        staticImgPath + 'Papir.png',
        staticImgPath + 'Steklo.png',
    ];

}]);



html

        <ul rn-carousel class="image"  rn-carousel-control attribute>
            <li data-ng-repeat="image in reminderWastesTypes">
                <img src="{{image}}">
            </li>
        </ul>

【问题讨论】:

    标签: javascript jquery angularjs angularjs-ng-repeat


    【解决方案1】:

    尝试使用 ng-src,而不是 src。 更多详情here

    【讨论】:

      猜你喜欢
      • 2014-10-19
      • 1970-01-01
      • 2013-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多