Created
June 4, 2014 12:33
-
-
Save daslicht/ddcc14ef86f5c4bdddd2 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
app.factory('uploadImage', function() { | |
var url = "/images"; | |
function uploadFiles(fileList,callback){ | |
... | |
} | |
function init(item){ | |
$(item).editable({ | |
inlineMode: true, | |
beforeFileUploadCallback: function (files) { | |
console.log(files); | |
uploadFiles(files,function(url){ | |
$(item).editable("writeImage", url); | |
console.log('done url: ',url); | |
}); | |
return false; | |
} | |
}); | |
} | |
return function(item){ | |
init(item); | |
} | |
}); | |
app.controller('Controller', function ($scope, $templateCache, uploadImage) { | |
$scope.master = {}; | |
$scope.show = function(){ //append | |
var item = $templateCache.get('templateId.html'); | |
console.log(item); | |
$('#formContainer').append(item); | |
uploadImage(item); | |
/*initialize wysiwyg editor, how do i get the proper added item here in order to attach the wysiwyg editor to it ?*/ | |
} | |
$scope.reset(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment