我正在运行Webprojekt whit FireBaseCloudMessaging。现在我必须在Typescript文件中调用一个方法来重新加载Notification上的消息。这可能吗?
HTML部分(index.html)
<script src="https://www.gstatic.com/firebasejs/4.3.0/firebase.js"></script>
<script>
messaging.onMessage(function(payload) {
console.log("Message received. ", payload);
// ChatDialog.reloadMessages(); <-- Here i have to call the Typescript Method
});
</script>
ChatDialog.ts
//This is the Method i have to call!
reloadMessages(){
this.messages.removeAll();
localStorage.clear();
ChatFunctions.getMessages(this, this.partner_id);
}