notifications-controller.coffee 390 B

1234567891011121314151617
  1. define [
  2. "base"
  3. ], (App) ->
  4. App.controller "NotificationsController", ($scope, $http) ->
  5. for notification in $scope.notifications
  6. notification.hide = false
  7. $scope.dismiss = (notification) ->
  8. $http({
  9. url: "/notifications/#{notification._id}"
  10. method: "DELETE"
  11. headers:
  12. "X-Csrf-Token": window.csrfToken
  13. })
  14. .success (data) ->
  15. notification.hide = true