| .. | .. |
|---|
| 19 | 19 | public constructor(private toaster: ToastsManager, |
|---|
| 20 | 20 | private router: Router, |
|---|
| 21 | 21 | private userService: UserService) { |
|---|
| 22 | + this.data.username = 'admin'; |
|---|
| 23 | + this.data.password = 'securis'; |
|---|
| 22 | 24 | } |
|---|
| 23 | 25 | |
|---|
| 24 | 26 | public login() { |
|---|
| 25 | 27 | this.userService.login(this.data.username, this.data.password).subscribe( |
|---|
| 26 | | - token => this.toaster.info('Hola'), |
|---|
| 27 | | - err => this.toaster.error('Hubo un error: ' + err)); |
|---|
| 28 | + token => this.router.navigateByUrl("packs"), |
|---|
| 29 | + errMsg => this.toaster.error(errMsg, 'Login error')); |
|---|
| 28 | 30 | } |
|---|
| 29 | 31 | |
|---|
| 30 | 32 | public clear() { |
|---|