I'm performing an app for tizen, but it has a lot of pure JS code and I faced with strange problem. I have such listener of event:
messagesChangeListener: function () {
var self = this, config,
messageChangeCallback = {
messagesupdated: function (updateMessages) {
//console.log('Message updated');
},
messagesadded: function (addedMessage) {
//console.log('Message added: ');
self.outputlog(addedMessage);
},
messagesremoved: function (removedMessages) {
//console.log('Message removed');
}
}; this.smsService.messageStorage.addMessagesChangeListener(messageChangeCallback);
},
outputlog: function(messages) {
console.log("Messages changed");
},
As you see I have event handlers, where commented calls of console log, but I get in this case error 'Cannot call method 'log' of undefined', I have to add new method outputlog for tests purpose. It works, but once Tizen emulator reloaded - it also stops working.
So:
Why I cann't call console.log directly from event handlers? I suppose it is a problem of visibility and a problem of pure JS. Am I right?
May be somebody know why method outputlog stops working after reloading of emulator? Here I suppose some specific problem of Tizen app and emulator.
Looks like you put a semicolon and extra curly here: