I am using angular CLI on the front-end side and I am using angular-formio for dynamic for building. but I am facing an issue in the passing of custom headers in API.
I created a form with select dynamic select dropdown and select data source type URL
. but I am unable to pass header value which is currently stored in my local storage.
when I use localStorage.getItem function in the headers value field, it takes it as a string and passes as it is in API headers. I found this link for passing custom headers, but this is a javascript method that I can't use in angular CLI application.
I just got the solution by my own which is
in response header area
provide a key 'key' and in value section call a localStorage Function like this.
{{localStorage.getItem('key')}}
now it will pass your custom headers as you want to pass.