Hello,
I have a user class
export class User {
constructor(
public email: string,
public password: string) { this.email=email;this.password=password}
}
I'm storing the values of this class in an array like this
users :User[]= [
];
after I create an add_user function that allows to add a user
add_user(user:User)
{
this.users.push(the problem is here );
console.log(this.users);
this._router.navigate(['login']);
}
ho can i do please ?
thanks in advance
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mangesh GRank #294 · 8.6K reputationPosted Jan 24, 2018, 6:28 AM EST
Dev TeywaRank #4,352 · 349 reputationPosted Jan 24, 2018, 8:24 AM EST
Manav PandyaRank #166 · 14.3K reputationPosted Jan 27, 2018, 10:43 PM EST