Created
January 31, 2014 00:03
-
-
Save robwormald/8722803 to your computer and use it in GitHub Desktop.
This file contains 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
angular.module('BBPlnkr').factory 'Widget', ($templateCache, Restangular) -> | |
_baseWidgets | |
_baseWidgets = Restangular.all('api/widgets') | |
widget = { | |
name: 'someWidget' #This needs to fuck off | |
} | |
#Added extra param to saveWidget | |
saveWidget: (snippets, fileName) -> | |
//or whatever | |
widget.file_name = fileName | |
for snippet in snippets | |
delete snippet.edited_body | |
widget.snippets_attributes = snippets | |
w = _baseWidgets.post widget | |
w |
davidpatters0n
commented
Jan 31, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment