Created
November 5, 2012 05:24
-
-
Save freshtonic/4015496 to your computer and use it in GitHub Desktop.
Angular JS injection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CreativesController = ($scope, Creative, flash) -> | |
| Creative.query (creatives) -> | |
| $scope.creatives = creatives | |
| # Delete an Creative | |
| $scope.remove = (creative) -> | |
| success = -> | |
| $scope.creatives = _.reject $scope.creatives, (s) -> s is creative | |
| flash.success 'successfully deleted creative' | |
| error = -> | |
| flash.error "could not delete creative #{err}" | |
| creative.$delete success, error | |
| CreativesController.$inject = ['$scope', 'Creative', 'flash'] | |
| Application.controller 'CreativesController', CreativesController |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment