ng-src没有绑定任何内容

时间:2017-12-23 16:52:43

标签: javascript angularjs data-binding

我正在尝试使用角度js,一切都很好,而不是这个。我从一个角度列表绑定完整的图像路径,如下所示:http://127.0.0.1:8000/uploads/uploads/1.PNG,但在inspect元素中,它显示ng-src,这是全部,不相等,没有路径,当然,没有图像显示起来。 我该怎么办?

提前致谢!

enter image description here

<h4 class="card-title">Misiuni</h4>
                <div class="row">
                    <div class="ribbon-wrapper card" ng-repeat="mission in missionList">
                        <div class="ribbon ribbon-default"><span ng-bind="mission.missionTitle"></span></div>
                            <p class="ribbon-content"><span ng-bind="mission.missionDesc"></span></p>
                                <center><br><h4 class="card-title">Reward:</h4></center>
                                <center><img ng-src="{{ mission.missionSrc }}"></center>
                                <center><br><h4 class="card-title">Experiență: <span ng-bind="mission.exp"></span></h4></center>
                                <input type="submit" class="btn btn-success" value="Acceptă misiunea">
                    </div>

                </div>

P.S:我仔细检查过,并且对于mission.missionSrc没有任何问题,它保存了正确的图像路径。

web.js

var app = angular.module('web', []);
app.controller('webController', function($scope, $http){

    //$scope.incomeList = [{incomeText: 'Primul income'}];
    $http.get('/api/missions').then(function(response){

        $scope.missionList = [];

        for(var i=0; i < response.data.length; i++){

            var mission = {};
            mission.missionTitle = response.data[i].title;
            mission.missionDesc = response.data[i].description;
            mission.missionSrc = response.data[i].reward;
            mission.exp = response.data[i].exp;
            $scope.missionList.push(mission);

            console.log(mission);

        }


    });
});

0 个答案:

没有答案