0

I'm quite new in Angular at all. What I'm doing is next, .net core is used for creating web api, and those api's are called from Angular4. Everything what I had did is working smoothly. Now I want on current page after submit form which is inserting records in database, need to redirect me to different page, but when I'm redirecting I should pass some data which will run another service which will call different API Controller from .net core with this passed data.

One stupid example: After I create user want to get new page where I can see user's First Name, Last Name, City want to get new page where I will see all ZIP codes for current City, because I have had call different api which is giving me all zip code for city which is passed to different component. Usually this is is going on one page with select list, but this is just example to understand what I'm trying to achieve.

Danijel Boksan
  • 779
  • 1
  • 13
  • 30
  • Possible duplicate of [How do I share data between components in Angular 2?](https://stackoverflow.com/questions/31026886/how-do-i-share-data-between-components-in-angular-2) –  Apr 13 '18 at 12:11
  • 1
    @trichetriche please review https://stackoverflow.com/help/be-nice being aggressive towards folks on SO does not help the community grow. – zmanc Apr 13 '18 at 12:30
  • Sorry if it seems agressive, it isn't. But 90% of the topics here can be solved by just reading the documentation. And for the record, I've been welcame like this for many questions of my own, and never had an issue with it. In fact, now I'm reading the documentation first ! –  Apr 13 '18 at 12:33
  • I hear ya @trichetriche, I've been the brunt of pretty harsh comments when I started too. But as we grow we can choose to perpetuate that or we can choose to help make it better. I like to assume most people did a search before posting, we can help them to search better and help post links for those who come behind. SO is living documentation, can't count how many times a link to another post or documentation came up when I googled and found an equally vague post. – zmanc Apr 13 '18 at 12:42
  • 2
    I totally agree. Again, I didn't want to be offensive, that's how I talk everyday (and as you can guess, it doesn't make a lot of people happy). My point being, in the end I gave him the links that he might need, and seeing the answer, I kind of helped him. But I get you, and I will try to make nicer comments. –  Apr 13 '18 at 12:45

1 Answers1

1

After you make the post of user data you can take the response from the server that contains all the information on the created user and use that to populate the data into the next step in your application.

I would suggest using routing with parameters, you can find information on that here. Since Angular uses its own internal router usually people do not use form submissions and page redirects that are more common in .net web forms. If you check out the http guide it will also help with effects of http requests.

zmanc
  • 5,201
  • 12
  • 45
  • 90