Created
November 14, 2015 19:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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