Because the timeout is not set at this point?

My Controller:

'use strict';

var AgentsController = BaseController.extend({

    $timeout: null,
    $resource: null,
    agenteModel: null,
    agenteService: null,
    ngTableParams: null,

    agentes: null,

    init: function ($scope, $timeout, $resource, agenteModel,
agenteService, ngTableParams) {
        this._super($scope);
        this.$timeout = $timeout;
        this.$resource = $resource;
        this.agenteModel = agenteModel;
        this.agenteService = agenteService;
        this.ngTableParams = ngTableParams;

        this.loadTable();
    },

    loadTable: function() {
        var Api = this.agenteService.listar2();

        this.$scope.tableParams = new this.ngTableParams({
            page: 1,
            count: 10,
            sorting: {
                Nome: 'asc'
            }
        }, {
            total: 0,
            getData: function ($defer, params) {
                Api.get(params.url(), function (data) {
                    *$timeout*(function () {* << ERROR HERE*
                        params.total(data.total);
                        $defer.resolve(data.result);
                    }, 500);
                });
            }
        });
    }

});
AgentsController.$inject = ['$scope', '$timeout', '$resource',
'AgenteModel', 'AgenteService', 'ngTableParams'];



-- 
Atenciosamente
Edmilson Lani

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to