Last active
December 17, 2019 22:05
-
-
Save umutyerebakmaz/6cc222080ddbb4bb96ee4adf6c2f5bae to your computer and use it in GitHub Desktop.
Angular 8 Reactive Form input değerini güncellemek.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | |
@Component({ | |
selector: 'app-form', | |
templateUrl: './form.component.html', | |
styleUrls: ['./form.component.scss'] | |
}) | |
export class FormComponent implements OnInit { | |
updateForm: FormGroup; | |
constructor(private formBuilder: FormBuilder) { } | |
ngOnInit() { | |
this.updateForm = this.formBuilder.group({ | |
title: ['', [Validators.required, Validators.required]], | |
slug: ['', [Validators.required, Validators.required]], | |
description: ['', [Validators.required, Validators.required]] | |
}); | |
} | |
onBlurTitle() { | |
const slug = 'bu-bir-slug-olmali'; | |
this.updateForm.patchValue({ slug: slug }); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment