0
「CH」在角1.6,傳遞行動起來(從表象組件控制器組件),我被放養在這:類型錯誤:不能使用「在」操作符來搜索喜
聊天(控制器成分)
const Chat = ['messages', function (ms) {
...
this.sendMessage = (userInput) => {
ms.sendMessage(userInput)
.then((res) => {
console.log(res)
})
}
}]
HTML模板:
<div class="messages">
<conversation messages="ch.messages" ng-if="ch.messages" ></conversation>
<user-input send="ch.sendMessage(userInput)"></user-input>
</div>
UserInput組分(表象成分):
const UserInput = function() {
...
this.checkAndSend =() => {
this.send(this.input)
this.input = this._clear()
}
}
angular
.module('chatbot-andrea')
.component('userInput', {
bindings: {
send: '&'
},
...
})