错误:dailyData [i]是未定义的angularjs

时间:2016-10-05 07:34:52

标签: javascript angularjs

我的代码有问题。实际上,当我运行应用程序时,我收到的信息如dailyData[i]未定义,我收到的表单为' undefined'。

这是我的代码:

(function() {
    var app = angular.module('starter.isu', ['ionic','ngCordova','ngMaterial']);

    app.controller('isuctrl', function($scope, $http) {
        var service_url = "https:code=isu";
        $http.get(service_url)
        .success(
        function(data) {
            console.log(data);

            dailyData =data.result.response.airport.pluginData.schedule.arrivals.data;

            $scope.dailyForecast = [];

            for(var i=0; i<25; i++)
            {
                $scope.dailyForecast[i] = {
                    callsign: dailyData[i].flight.identification.number.default,
                    statu: dailyData[i].flight.status.generic.status.text,
                    airline: dailyData[i].flight.airline.code.icao,
                    from: dailyData[i].flight.airport.origin.position.region.city,
                    timear: dailyData[i].flight.time.scheduled.arrival,
                    generic: dailyData[i].flight.status.text,
                };
            }
        })
    })
})();

0 个答案:

没有答案