Skip to content

Commit b17f215

Browse files
committed
fixed next lesson code
1 parent 10ffadc commit b17f215

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/app/pages/user/course/course.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<app-lesson
7575
*ngIf="show === 'lesson' && lesson && certificate"
7676
[certificate]="certificate"
77+
(nextLesson)="nextLesson()"
7778
[lesson]="lesson"
7879
[tests]="tests"
7980
></app-lesson>

src/app/pages/user/course/lesson/lesson.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input } from '@angular/core';
1+
import { Component, EventEmitter, Input, Output } from '@angular/core';
22
import { Value } from 'src/app/core/modules/input/input.component';
33
import { TranslateService } from 'src/app/core/modules/translate/translate.service';
44
import { Schoolcertificate } from 'src/app/modules/schoolcertificate/interfaces/schoolcertificate.interface';
@@ -22,6 +22,8 @@ export class LessonComponent {
2222

2323
@Input() tests: Schooltest[] = [];
2424

25+
@Output() nextLesson = new EventEmitter();
26+
2527
constructor(
2628
private _translate: TranslateService,
2729
private _alert: AlertService,
@@ -44,6 +46,8 @@ export class LessonComponent {
4446
.subscribe((resp: Schoolcertificate) => {
4547
if (resp) {
4648
this._core.copy(resp, this.certificate);
49+
50+
this.nextLesson.emit();
4751
} else {
4852
this._alert.warning({
4953
text: this._translate.translate(

0 commit comments

Comments
 (0)