Skip to content

Instantly share code, notes, and snippets.

@klaascuvelier
Last active December 19, 2015 21:09
Show Gist options
  • Save klaascuvelier/6018397 to your computer and use it in GitHub Desktop.
Save klaascuvelier/6018397 to your computer and use it in GitHub Desktop.
// some exampe controller
Module.controller('Example', ['$scope', '$http', '$url', function ($scope, $http, $url) {
// fetch assets from php controller
$scope.fetchFromTo(from, to) {
var url = $url.get('acme_get_assets_from_to', { type: 'documents', from: from, to: to });
$http.get(url)
.success(function () {
// do something with the result
})
.error(function () {
// something went wrong
})
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment