我现在正在学习JDBC,我已经知道PreparedStatement和Statement之间的区别.PreparedStatement是预先编译的并且允许您设置参数,但是在工作面试中我被问到关于PreparedStatement批处理和Statement批处理之间的区别的问题?
我订阅了一个组件(Angular2)的ngOnInit(),然后在ngOnDestroy()中取消订阅.第二次初始化我的组件后,它给了我一个错误:
ObjectUnsubscribedError: object unsubscribed
Run Code Online (Sandbox Code Playgroud)
在我的课上我有:
ngOnInit() {
this.chatService.getConversationsEvent()
.subscribe((data:Data<Array<Conversation>>) => {
console.log('from correspondence');
});
this.scrollToBottom();
}
ngOnDestroy() {
this.chatService.getConversationsEvent().unsubscribe();
}
Run Code Online (Sandbox Code Playgroud)