-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Grading,Forgot Password): Use component binding to clean up …
…code (#1509)
- Loading branch information
1 parent
ee98c7e
commit 07d3ef6
Showing
9 changed files
with
51 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 6 additions & 17 deletions
23
...ot/student/forgot-student-password-complete/forgot-student-password-complete.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { Component, Input } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-forgot-student-password-complete', | ||
templateUrl: './forgot-student-password-complete.component.html', | ||
styleUrls: ['./forgot-student-password-complete.component.scss'] | ||
}) | ||
export class ForgotStudentPasswordCompleteComponent implements OnInit { | ||
username: string = null; | ||
export class ForgotStudentPasswordCompleteComponent { | ||
@Input() username: string; | ||
|
||
constructor(private router: Router, private route: ActivatedRoute) {} | ||
|
||
ngOnInit() { | ||
const username = this.route.snapshot.queryParamMap.get('username'); | ||
if (username != null) { | ||
this.username = username; | ||
} | ||
} | ||
constructor(private router: Router) {} | ||
|
||
goToLoginPage() { | ||
const params: any = {}; | ||
if (this.username != null) { | ||
params.username = this.username; | ||
} | ||
this.router.navigate(['/login', params]); | ||
this.router.navigate(['/login', { username: this.username }]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 6 additions & 17 deletions
23
...ot/teacher/forgot-teacher-password-complete/forgot-teacher-password-complete.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { Component, Input } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-forgot-teacher-password-complete', | ||
templateUrl: './forgot-teacher-password-complete.component.html', | ||
styleUrls: ['./forgot-teacher-password-complete.component.scss'] | ||
}) | ||
export class ForgotTeacherPasswordCompleteComponent implements OnInit { | ||
username: string = null; | ||
export class ForgotTeacherPasswordCompleteComponent { | ||
@Input() username: string; | ||
|
||
constructor(private router: Router, private route: ActivatedRoute) {} | ||
|
||
ngOnInit() { | ||
const username = this.route.snapshot.queryParamMap.get('username'); | ||
if (username != null) { | ||
this.username = username; | ||
} | ||
} | ||
constructor(private router: Router) {} | ||
|
||
goToLoginPage() { | ||
const params: any = {}; | ||
if (this.username != null) { | ||
params.username = this.username; | ||
} | ||
this.router.navigate(['/login', params]); | ||
this.router.navigate(['/login', { username: this.username }]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters