How to receive a redirect from mapForm and access the params on the body or header?

11 views
Skip to first unread message

Sérgio Paulo Gomes

unread,
Oct 28, 2020, 7:28:39 AM10/28/20
to Angular and AngularJS discussion
Hello everyone!

I have two applications.
One is opening my Angular application through a redirect request.
And I need to pass a param.
This is the way I'm doing:

```
  post(obj, url) {
        const mapForm = document.createElement('form');
        mapForm.target = '_blank';
        mapForm.method = 'POST';
        mapForm.action = url;
        Object.keys(obj).forEach(param => {
            const mapInput = document.createElement('input');
            mapInput.type = 'hidden';
            mapInput.id = param;
            mapInput.name = param;
            mapInput.setAttribute('value', obj[param]);
            mapForm.appendChild(mapInput);
        });
        document.body.appendChild(mapForm);
        mapForm.submit();
    }
```

But how can I receive this param on the Angular application?
Reply all
Reply to author
Forward
0 new messages