Skip to content

Instantly share code, notes, and snippets.

@jonathansolorzn
Created November 14, 2015 19:20
Show Gist options
  • Save jonathansolorzn/3bbbe6fd2efb4c7844f5 to your computer and use it in GitHub Desktop.
Save jonathansolorzn/3bbbe6fd2efb4c7844f5 to your computer and use it in GitHub Desktop.
This is a service to get the json file that contains the static data of a website, it's used in this controller: https://gist.github.com/feniixx/1b170ed39a557329372e
(function () {
'use strict';
angular
.module( 'app.core' )
.service( 'contentService', contentService );
contentService.$inject = [ '$http' ];
function contentService( $http ) {
//I would like to return the data directly from this service, not a promise.
this.content = function () {
return $http.get( '/api/v1/content' );
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment