Created
May 28, 2014 08:18
-
-
Save Ulv/377f569897b9dd19f87c to your computer and use it in GitHub Desktop.
angularjs, coffeescript: app dataService (with promise)
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
| # Usage examples: | |
| # | |
| # dataService.getTree().then((response)-> | |
| # if response | |
| # $scope.list = response.data | |
| # | |
| # dataService.saveTree(nodeData) | |
| .service "dataService", ($http) -> | |
| delete $http.defaults.headers.common["X-Requested-With"] | |
| @getTree = -> | |
| $http | |
| method: "GET" | |
| url: "/admin/widget-menu/menutree/get" | |
| @saveTree = (data) -> | |
| $http.post "/admin/widget-menu/menutree/save", | |
| JSON.stringify data | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment