@jesst446 wrote:
I have a chat application was working fine yesterday and now its coming up with loads of errors. I am new to ionic so im not sure how i would go about fixing them. Here are the errors from the console.
the send button doesnt work the code on the controller.js is
$scope.sendMessage = function (msg) {
console.log(msg);
Chats.send($scope.displayName, msg);
$scope.IM.textMessage = "";
}$scope.remove = function(chat) { Chats.remove(chat); }
})
code from the services js is
send: function (from, message) {
console.log("sending message from :" + from.displayName + " & message is " + message);
if (from && message) {
var chatMessage = {
from: from.displayName,
message: message,
createdAt: Firebase.ServerValue.TIMESTAMP
};
chats.$add(chatMessage).then(function (data) {
console.log("message added");
});
}
}
}
})Please help
Posts: 5
Participants: 2