Angular 2 - form data

I am the only one who gets an empty formData {} after adding I am working with the latest version of angular 2.

let formData: FormData = new FormData()
   formData.append('key','value')
   console.log(formData)

Result:

FormData { }
+4
source share
1 answer

FormDatais not a simple js object, API link: https://developer.mozilla.org/en/docs/Web/API/FormData

let data = new FormData();
data.append('key', 'value');
console.log(data.get('key'))
+3
source

Source: https://habr.com/ru/post/1671410/


All Articles