Ich bin neu in Coffeescript. Ich habe bereits Code in js
geschrieben, jetzt möchte ich es in coffeescript
umwandeln, ich habe viel versucht, ich habe This auch verweisen. aber es wird mir nicht helfen.CoffeeScript Funktion Ausgabe
hier ist mein Code,
this.$scope.callTestFuntion = function(){
this.blockingObject.render(function(dataURL){
console.log('via render');
console.log(dataURL.length);
});
}
this.$scope.blockingObject.callback=function(dataURL){
console.log('via function');
console.log(dataURL.length);
this.myCroppedImage = dataURL;
}
var handleFileSelect=function(evt) {
console.log('here');
var file=evt.currentTarget.files[0];
var reader = new FileReader();
reader.onload = function (evt) {
this.$scope.$apply(function($scope){
this.$scope.myImage=evt.target.result;
});
};
reader.readAsDataURL(file);
};
Ich möchte es in Coffeescript-Syntax konvertieren. Bitte hilf mir.
Dank
Warum möchten Sie JS in Coffescript umwandeln, das schließlich/zwangsläufig in JS konvertiert wird? – Thomas