Commit 764f2eb9 authored by liujiangnan's avatar liujiangnan

fix: 显示问题

parent ed4ea037
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core';
import { Component, ElementRef,ApplicationRef,ChangeDetectorRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core';
import * as _ from 'lodash';
......@@ -28,7 +28,8 @@ export class PlayComponent implements OnInit {
wrongAudio = new Audio();
options: any[];
constructor() {
constructor(private appRef: ApplicationRef,
public changeDetectorRef: ChangeDetectorRef) {
this.rightAudio.src = 'assets/right.mp3';
this.rightAudio.load();
this.wrongAudio.src = 'assets/wrong.mp3';
......@@ -59,7 +60,9 @@ export class PlayComponent implements OnInit {
this.data = data;
}
this.init();
window["air"].hideAirClassLoading(this.saveKey, this.data)
window["air"].hideAirClassLoading(this.saveKey, this.data);
this.refresh();
}, this.saveKey);
}
......@@ -169,5 +172,11 @@ export class PlayComponent implements OnInit {
}
}
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment