Skip to content

Instantly share code, notes, and snippets.

@dphase
Created September 11, 2014 16:48
Show Gist options
  • Save dphase/3dab5dcf0050c2d6e831 to your computer and use it in GitHub Desktop.
Save dphase/3dab5dcf0050c2d6e831 to your computer and use it in GitHub Desktop.
getTeacherIndex = (scope, page=1, filter='', schools='') ->
$timeout.cancel(timeoutId) if timeoutId
timeoutId = $timeout( ->
$http
.get("/api/v3/cjunction/teachers.json?scope=#{scope}&page=#{page}&filter=#{filter}&schools=#{schools}")
.then (res) ->
vm.teachers = res.data.teachers
vm.total = res.data.total
res.data
, 333)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment