Commit f2a3a221 authored by Chen Jiping's avatar Chen Jiping

feat:增加默认值

parent 97f314e5
...@@ -38,7 +38,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -38,7 +38,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (data) { if (data) {
this.item = data; this.item = data;
} }
console.log(this.item); //console.log(JSON.stringify(this.item));
this.init(); this.init();
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
......
...@@ -112,6 +112,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -112,6 +112,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if (data && typeof data == 'object') { if (data && typeof data == 'object') {
this.data = data; this.data = data;
} }
else{
let defaultData = JSON.parse('{"title":{"part1":"C","part2":"Read and point"},"exercisesArr":[{"answerArr":[{"index":0,"val":"she"},{"index":0,"val":"will"},{"index":0,"val":"prepare"},{"index":0,"val":"some"},{"index":0,"val":"soap"},{"index":0,"val":"for"},{"index":0,"val":"dinner"},{"index":0,"val":"with"},{"index":0,"val":"me"}],"val":"she will prepare some soap for dinner with me.","picUrl":"http://staging-teach.cdn.ireadabc.com/9db9d97240bd50d77b432aa5f1cd0727.png","audioUrl":"http://staging-teach.cdn.ireadabc.com/919b2c150b41b3306869ebe78ecb70b3.mp3"}]}');
}
// console.log('data:' , data); // console.log('data:' , data);
// 初始化 各事件监听 // 初始化 各事件监听
......
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