USER_EMAIL,
USER_PASSWORD
} from '../shared'
+import { UserCreate } from '../../../../shared'
@Component({
selector: 'my-signup',
- templateUrl: './signup.component.html'
+ templateUrl: './signup.component.html',
+ styleUrls: [ './signup.component.scss' ]
})
export class SignupComponent extends FormReactive implements OnInit {
error: string = null
signup () {
this.error = null
- const { username, password, email } = this.form.value
+ const userCreate: UserCreate = this.form.value
- this.userService.signup(username, password, email).subscribe(
+ this.userService.signup(userCreate).subscribe(
() => {
- this.notificationsService.success('Success', `Registration for ${username} complete.`)
+ this.notificationsService.success('Success', `Registration for ${userCreate.username} complete.`)
this.router.navigate([ '/videos/list' ])
},
- err => this.error = err.text
+ err => this.error = err.message
)
}
}