Skip to content

Instantly share code, notes, and snippets.

@Insayt
Created November 17, 2015 11:45
Show Gist options
  • Save Insayt/ca7a299792d4c492082e to your computer and use it in GitHub Desktop.
Save Insayt/ca7a299792d4c492082e to your computer and use it in GitHub Desktop.
Service
app.factory('$dataApi', function($http, $Api) {
return {
getCountries: function() {
return $http.get(appConfig.apiBase + 'country/index');
},
getStates: function(countryId) {
return $Api.get(appConfig.apiBase + 'state/index/?country=' + countryId);
},
getTimezones: function() {
return $http.get(appConfig.apiBase + 'timezone/index');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment