本文整理汇总了TypeScript中@angular/forms.FormGroup.getRawValue方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FormGroup.getRawValue方法的具体用法?TypeScript FormGroup.getRawValue怎么用?TypeScript FormGroup.getRawValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/forms.FormGroup
的用法示例。
在下文中一共展示了FormGroup.getRawValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.subscribe((response: FormGroup) => {
if ( !response )
{
return;
}
this._contactsService.updateContact(response.getRawValue());
});
示例2: oncklick
/**
* Gets and checks the login form data
*/
oncklick() {
const credentials = this.login.getRawValue();
if (credentials.email === 'finnziehe@mailbox.org' && credentials.password === 'bacon1234' ) {
this.router.navigate(['/menue']);
this.setloggin(true);
} else {
alert('Falsche Daten');
}
}
示例3: signup
signup() {
const newUser = this.signupForm.getRawValue() as NewUser;
this.signUpService
.signup(newUser)
.subscribe(
() => this.router.navigate(['']),
err => console.log(err)
);
}
示例4: addNumbers
addNumbers() {
const value: {
numberA: string,
numberB: string
} = this.calculatorForm.getRawValue();
const numberA = parseInt(value.numberA);
const numberB = parseInt(value.numberB);
this.result = this.calculator.addNumbers(numberA, numberB);
}
示例5: saveProduct
/**
* Save product
*/
saveProduct(): void
{
const data = this.productForm.getRawValue();
data.handle = FuseUtils.handleize(data.name);
this._ecommerceProductService.saveProduct(data)
.then(() => {
// Trigger the subscription with new data
this._ecommerceProductService.onProductChanged.next(data);
// Show the success message
this._matSnackBar.open('Product saved', 'OK', {
verticalPosition: 'top',
duration : 2000
});
});
}
示例6: addRepository
addRepository() {
this.isProcessing = true;
this.addRepositoryForm.disable();
this.http.post(
'/v1/api/helm/repositories',
this.addRepositoryForm.getRawValue()
).pipe(
catchError(error => {
this.notifications.display('error', '', error.statusText);
return of(new ErrorEvent(error));
})
).subscribe(result => {
this.isProcessing = false;
this.addRepositoryForm.enable();
// TODO
if (!(result instanceof ErrorEvent)) {
window.location.reload();
}
});
}
示例7: login
/**
* Login with current user/pass
*/
public login(): void {
if (this.formGroup.valid) {
this.formGroup.disable();
// -->Set: data
const data = this.formGroup.getRawValue();
data.grant_type = 'password';
this.http.login(data)
.subscribe(ok => {
this.router.navigate(['/dashboard']);
}, err => {
console.error('error', err);
setTimeout(() => { this.formGroup.enable(); }, 1500);
});
} else {
const errors = SuperForm.getAllErrorsFlat(this.formGroup);
console.error(errors);
}
}
示例8: switch
.subscribe(response => {
if ( !response )
{
return;
}
const actionType: string = response[0];
const formData: FormGroup = response[1];
switch ( actionType )
{
/**
* Send
*/
case 'send':
console.log('new Mail', formData.getRawValue());
break;
/**
* Delete
*/
case 'delete':
console.log('delete Mail');
break;
}
});
示例9: createPost
createPost() {
return this.store
.dispatch(createPost(this.postForm.getRawValue()));
}
示例10: reset
reset() {
const val = this.form.getRawValue();
this.graph.post(`{resetPassword(username:"${val.username}",email:"${val.email}")}`).subscribe(res => {
this.router.navigate(['/login']);
})
}