Sherzy
6/8/2016 - 10:11 PM

Using a deferred in controller

Using a deferred in controller

advisorService.getData(searchObj)
    // then() called when service gets back
    .then(function (data) {
        $scope.allAdvisors = data;
    }, function (error) {
        // promise rejected, could log the error with: console.log('error', error);
    }
);