Search code examples
angulartypescriptrenderer

Use "renderer/renderer2" in Angular to get value of DOM input in component


I have started learning Angular recently, I want to take the value from a form and send it to a database [Firebase]. I'm using angularfire2.

According to docs there is "setValue()" method but no "value()" or "getValue()" methods. Is there any other method to use?

-TIA


Solution

  • There's a get property called value in the formgroup API in angular.

    you can get the value of the form group using this.yourFormGroupName.value.

    If you want to get the value of the disabled controls, you can use getRawValue() method. this.yourFormGroupName.getRawValue().