0

In my controller and my view i have some content thats being. Some of the data is coming from api calls.

For example i have info coming from the database and now the user can update their information such as their last name. When they submit the data i make a call to the api to update the database for the users last name. Now what i want is for the page data to reflect the new user content from the database. I dont want to completely reload the page and i dont want to take what they put in the input and show that but instead completely have the page content reloaded without reloading the page. Is this possible?

1
  • Yes this is possible. Since the data is coming from the app itself, you should just be able to update the data in javascript if the update is successful. Alternatively you could re-fetch the data Commented Jan 19, 2015 at 23:36

1 Answer 1

1

If it were me I'd just add the new data to your $scope array after the promise or successful response from your server comes in. Or if that makes you nervous, you could re-request the array from the api after the promise. But IMO that could result in a lot of un-needed bandwidth.

Sign up to request clarification or add additional context in comments.

2 Comments

Ya i dont want to add it to the scope and wanted to avoid calling the api again but looks like thats the only option i have. I was hoping there would be another way but i didnt think so.
Yeah, you're going to have to add it to the scope either way for it to show up on your view...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.