|
@@ -1,6 +1,7 @@
|
1
|
1
|
import { Component } from '@angular/core';
|
2
|
2
|
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
3
|
3
|
import {MenuPage} from "../menu/menu";
|
|
4
|
+import { UsersService } from '../../providers/users-service';
|
4
|
5
|
|
5
|
6
|
/**
|
6
|
7
|
* Generated class for the SignupPage page.
|
|
@@ -15,17 +16,19 @@ import {MenuPage} from "../menu/menu";
|
15
|
16
|
templateUrl: 'signup.html',
|
16
|
17
|
})
|
17
|
18
|
export class SignupPage {
|
18
|
|
- account: { profilename: string, username: string, password: string } = {
|
19
|
|
- profilename:'',
|
20
|
|
- username:'',
|
|
19
|
+ account = {
|
|
20
|
+ profileName:'',
|
|
21
|
+ userName:'',
|
21
|
22
|
password:''
|
22
|
23
|
};
|
23
|
24
|
|
24
|
|
- constructor(public navCtrl: NavController, public navParams: NavParams) {
|
|
25
|
+ constructor(public navCtrl: NavController, public navParams: NavParams, private usersService: UsersService) {
|
25
|
26
|
}
|
26
|
27
|
|
27
|
|
- doSignup() {
|
28
|
|
- this.navCtrl.setRoot(MenuPage);
|
|
28
|
+ createAccount() {
|
|
29
|
+ this.usersService.addUser(this.account).subscribe(response => {
|
|
30
|
+ this.navCtrl.setRoot(MenuPage);
|
|
31
|
+ })
|
29
|
32
|
}
|
30
|
33
|
|
31
|
34
|
}
|