I'm trying to create a button in a non-angular app that will open an angular form with some fields pre-filled. The URL has ?name1=value1&name2=value2, but the fields are not pre-filled when the form appears. Is there a way to do this?
Asked
Active
Viewed 201 times
0
-
You haven't provided any code or stackblitz to provide you any help/suggestion. Please add as much as reference possible, so it's easier for other to help you. – Nehal Jun 21 '22 at 01:49
-
Angular is SPA, so you don't open an angular form else an Angular app. Do you have your angular app ready when you has the button (see, e.g. this [SO](https://stackoverflow.com/questions/62081958/calling-typescript-function-from-javascript-file-in-angular/62082111#62082111) (it's a kind of comunicate javascript with Angular) or you want to open an Angular app that read the queryparams at first (you can do it in [APP_INITIALIZER](https://angular.io/api/core/APP_INITIALIZER) or just [read the query string](https://angular.io/guide/router#accessing-query-parameters-and-fragments))? – Eliseo Jun 21 '22 at 06:28
-
This is an example of a URL I tried to open a form with fields pre-filled: https://locator.ice.gov/odls/#/index?alienNumber=123456789&countryOfBirth=Liberia – alecw Jun 22 '22 at 12:55