(function () {
    'use strict';
    /**
     * @ngdoc function
     * @name sbAdminApp.controller:MainCtrl
     * @description
     * # MainCtrl
     * Controller of the sbAdminApp
     */
    angular.module('BlurAdmin.pages.mybills.usageinfo')
        .controller('usageinfoCtrl', usageinfoCtrl);

    /** @ngInject */
   function usageinfoCtrl($scope, $http, $timeout) {

        var self = this;
//        self.ttt;

        self.ttt = '201601';
        self.isLoading = true;
        self.callServer = function callServer(thedate) {
            $timeout(function () {
                $http({method: 'get', url: '/billinglistquery/' + thedate}).success(function (incomingData) {
                        self.displayed = incomingData;
                        self.displayedCollection = [].concat(self.displayed);
                        self.isLoading = false;


                    }
                );
            }, 1000);
        }

        //$scope.displayedCollection=[].concat(self.displayed);


        self.callServer('201601');

        self.updateTable = function updateTable(adate) {
            self.isLoading = true;
            self.callServer(adate);
        }


    }
})();
