Save and print the value of a property

0

I am trying to save the value I have in a property as text, I have printed the value in the console and it does not give me problems and I want that same value when creating a database is the name that the table will have, at the moment to run it tells me that value as UNDEFINED in Firebase where the database is displayed, in my case it is the variable "a" that I want to detect as text within the variable contatcsref , I do not know if it is any Wrong way of writing

This is my code:

export class RegisterService{

public mail : string;
public a : string;

private contactsRef=this.db.list<Registro>(this.a +'/Horas Ingresadas');

constructor(private db:AngularFireDatabase ){

}

recibirmail(value: string){
    this.mail=value;
    var split= this.mail.split('@',2);
    this.a= split[0];
    console.log(this.a);
}    
    
asked by Diego Jaramillo 23.04.2018 в 23:36
source

0 answers