0
서비스에서 채팅 메시지를 가져 오는 Angular2 앱으로 게임을합니다. 푸시 알림이 주어지면 앱은 서비스의 모든 메시지를 다시 가져옵니다. 이것은 IE를 제외한 모든 브라우저에서 잘 작동합니다. 푸시 알림 기능은 정상적으로 작동하며 앱은 모든 메시지가 IE에서도 올바르게 반입된다는 것을 기록하지만 브라우저가 업데이트 된 콘텐츠를 다시 렌더링하지 않는 것으로 보입니다. (IE 11). 이것이 일어나지 않는 이유에 대한 제안?Angular2 페이지가 업데이트되었지만 IE에는 없습니다
구성 요소 발췌 :
이ngOnInit(){
this.getMessages();
this.pusher = new Pusher('PUSHER_KEY');
this.channel = this.pusher.subscribe('test_channel');
this.channel.bind('my_event', (data) =>{
this.getMessages();
});
console.log('In OnInit');
}
sendMessage(message:string): void{
this._service.postMessage(this.id, message);
console.log('Send Message called');
}
getMessages():void{
this._service.getMessages(this.id)
.subscribe(
messages => this.messages = messages,
error => this.errorMessage = <any>error);
}
템플릿 :
<div class="panel-body">
<div class="row">
<div class="col-md-2">Add Message: </div>
<div class="col-md-2"><input type="text" [(ngModel)]='newMessage' /> <button class="btn btn-primary" (click)='sendMessage(newMessage)'>Send</button></div>
</div>
<div class="table-responsive">
<table class="table" *ngIf='messages && messages.length'>
<thead>
<tr>
<th>Messages</th>
</tr>
</thead>
<tbody>
<tr *ngFor='#message of messages'>
<td>{{message}}</td>
</tr>
</tbody>
</table>
</div>
</div>
시도 IE 행동에. – kenander
이 재현하려면 Plunker가 필요합니다. –