如何在提交之前以编程方式将值附加到我的源对象属性中

时间:2019-06-18 13:02:53

标签: nativescript-angular

我有一个严重依赖raddataform的应用程序,该应用程序从用户那里获取输入。一些字段对于用户不可用,因为它们的值将以编程方式附加。我该如何将这些值附加到幕后,而无需用户手动输入。

我知道提交事件propertyCommit和propertyCommitted以及如何使用它们来获取当前提交的值,但是我不知道如何以编程方式附加值

这是我的源对象

class Person {
name: string;
email: string;
createdBy: string;

constructor(name,email){
this.name = name;
this.email = email;
}

在我的CreateUserCompenent中:

...
userSourceObj: User; // this is my variable for the source object
...
ngOnInit() {
 this.userSourceObj = new User('John Doe','john.doe@bar.com');
}

我想在表单提交期间将一个值附加到用户对象的createdBy字段中。

0 个答案:

没有答案