Guest User

Untitled

a guest
Jul 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public myForm: FormGroup
  2.  
  3. constructor(private formBuilder: FormBuilder) { }
  4.  
  5. ngOnInit() {
  6. this.myForm = this.formBuilder.group({
  7. enabledControl: ['hello'],
  8. disabledControl: [{
  9. value: 'world',
  10. disabled: true
  11. }],
  12. })
  13.  
  14. console.log(this.myForm.value)
  15. /*
  16. Outputs:
  17. {
  18. enabledControl: 'hello'
  19. }
  20. */
  21.  
  22. console.log(this.myForm.getRawValue())
  23. /*
  24. Outputs:
  25. {
  26. enabledControl: 'hello',
  27. disabledControl: 'world'
  28. }
  29. */
  30. }
Add Comment
Please, Sign In to add comment