My callback function is being wrapped as an object when process into JavaScript. The browser throws this error because of it:
Uncaught TypeError: object is not a function
The CoffeeScript:
startCamera: ->
@media = $('#camera').getUserMedia {},
success: (obj) ->
console.log obj
return
return
The Output:
startCamera: function() {
this.media = $('#camera').getUserMedia({}, {
success: function(obj) {
console.log(obj);
}
});
}
How can I build a regular anonymous function for the parameter?