Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created December 9, 2011 22:48
Show Gist options
  • Select an option

  • Save daniel-nelson/1453665 to your computer and use it in GitHub Desktop.

Select an option

Save daniel-nelson/1453665 to your computer and use it in GitHub Desktop.
angular.service 'DailyCount', ($resource) ->
$resource '/analytics/doc_totals/:doc_id?tz_offset=:tz_offset&start_date=:start_date&end_date=:end_date', {}, { 'get': { method: 'GET', isArray: false }}
angular.service 'OpenEvents', ($resource) ->
$resource '/analytics/docs/:doc_id?tz_offset=:tz_offset&event=open&start_date=:start_date&end_date=:end_date', {}, { 'index': { method: 'GET', isArray: true }}
angular.service 'SessionEvents', ($resource) ->
$resource '/analytics/docs/:doc_id?session_id=:session_id', {}, { 'index': { method: 'GET', isArray: true }}
@mhevery

mhevery commented Dec 9, 2011

Copy link
Copy Markdown

angular.module.myModule = ['$provide', '$resource', function($provide, $resource) {
$provide.value('DailyCount', ($resource) ->
$resource '/analytics/doc_totals/:doc_id?tz_offset=:tz_offset&start_date=:start_date&end_date=:end_date', {}, { 'get': { method: 'GET', isArray: false }});
}];

angular.injector('mModule');
or

<script src=.... ng:autobind ng:module="myModule"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment