JSFiddle - React, Tailwind, and code Playground
by fredrik
JavaScript
angular.module('presentationServices', ['ngResource']).
factory('Presentation', function ($resource) {
return $resource(':path', { path : '/api/a.json' }, {
urlOptions : {
encodeUri : false
},
query : {
method : 'GET',
isArray : false
}
});
});
function BenderController ($scope, Presentation) {
$scope.presentations = Presentation.get({ path : '/api/test.json' });
// Or with callback
$scope.presentations = Presentation.get({ path : '/api/test.json' }, function () {
// do stuff when request is done
});
}