use .$promise.then() on returning Ajax