Reference.child failed: First argument was an invalid path = “undefined”. Paths must be non-empty strings and can’t contain “.”, “#”, “$”, “[”, or “]”
any solution with this code…plis help me
import { Component } from ‘@angular/core’;
import { IonicPage, NavController, LoadingController, ToastController, NavParams } from ‘ionic-angular’;
import { UserserviceProvider } from ‘…/…/providers/userservice/userservice’;
import { HomePage } from ‘…/home/home’;
/**
- Generated class for the RegisterPage page.
- See https://ionicframework.com/docs/components/#navigation for more info on
- Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: ‘page-register’,
templateUrl: ‘register.html’,
providers: [UserserviceProvider]
})
export class RegisterPage {
public first_name : any;
public last_name : any;
public email : string;
public password : any;
public phone : any;
public state : any;
constructor(public navCtrl: NavController, public navParams: NavParams,
public usersserviceProvider : UserserviceProvider,
public toastCtrl: ToastController, public loadingCtrl: LoadingController) {
//
}
ionViewDidLoad() {
console.log(‘ionViewDidLoad RegisterPage’);
}
doSignup(){
var account = {
first_name: this.first_name,
last_name: this.last_name,
email: this.email,
password: this.password,
phone: this.phone,
state: this.state
};
var that = this;
var loader = this.loadingCtrl.create({
content: “Please wait…”,
});
loader.present();
this.usersserviceProvider.signupUserService(account).then(authData => {
//successful
loader.dismiss();
that.navCtrl.setRoot(HomePage);
}, error => {
loader.dismiss();
// Unable to log in
let toast = this.toastCtrl.create({
message: error,
duration: 3000,
position: ‘top’
});
toast.present();
that.password = ""//empty the password field
});
}
}