Skip to content

Instantly share code, notes, and snippets.

@Siron
Created January 22, 2015 09:22
Show Gist options
  • Save Siron/27195a0f08b069db988d to your computer and use it in GitHub Desktop.
Save Siron/27195a0f08b069db988d to your computer and use it in GitHub Desktop.
editorData = []
$scope.editor.onFormSubmit()
data = $scope.editor.store.retrieve()
data.data.forEach (block) ->
unless _.isEmpty(block.data)
editorData.push
position: block.position
type: block.type
data: block.data
editorData = _.sortBy(editorData, (block) -> return block.position)
$scope.contentToSave = editorData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment