Skip to content

Instantly share code, notes, and snippets.

@okdas
Created April 20, 2015 10:12
Show Gist options
  • Save okdas/4c5478a12cdb66db94fe to your computer and use it in GitHub Desktop.
Save okdas/4c5478a12cdb66db94fe to your computer and use it in GitHub Desktop.
(-> res = []; res.push val for val in (data.map (e) -> e.triggerid) when val not in res; res)
.forEach (triggerid) ->
$rootScope.$broadcast 'event:new', (data.filter (event) -> if event.triggerid is triggerid then yes else no)[-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment