$http and $q service usage with promise

$http and $q service usage with promise