想象两个表,用户和地址。 地址通过一对多关系连接到用户。
我想在 signup(( 上将记录添加到地址表中
signup(firstName, lastName, email, {'what should I be' : 'what should I be'})
是否必须使用注册参数来完成? 或者还有其他方法。
您可以使用 2 种方法:
1(使用Back&Actions - 服务器端逻辑,在您创建用户注册后。
2(使用您的代码,例如:
this.backand.signup(firstName, lastName, email)
.then((data: any) => {
console.log('Sign up succeeded');
//Do here the Address thing to update the addrss table...
},
(err: any) => {
console.log(err)
}
);