Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
In my service after log in I am downloading from rest some data, and base on them I am display some tab or not. How can I load the HTML when data is already loaded? ngif at the begin of HTML does not work. I need to refresh page to load correct tabs. Thanks in advance.
Best Regards
You want to use an Angular Route Resolver for this. Resolvers prevent the route being loaded until the data is loaded. A Guard is not the correct approach. A Guard is used to prevent access to a route based on some sync / async condition and not for pre-loading route data.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 months ago.
Improve this question
I try to fetch some data from api and store the data in a userdefault, then in another func to use the value in the userdefault. But sometimes when I try to get the value in the userdefault, it has not been fetched from api because of the poor internet, so how can I make sure I can get the data before I execute the second func.
Or do you have any solutions?
Thank you guys
There can always be conditions where you can fail a fetch. When you are executing your function that uses the data you were fetching you can first make sure there is any data at all, before manipulating it.
For slow internet specifically, you can check "retries" and retry mechanisms: example
One more thing, UserDefaults shouldn't be used for storing large data, it's typically used for storing some user preferences like colors, fonts, etc. (It's not encrypted - unsafe)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Good day.
I was faced with the task, can not find the answers on the internet, can anyone be able to help.
I need to send a request to the service. This request must be sent no more than 1 second once per hour. From the answer to the query to extract part of the data. When you receive or availability of this information, it should be added to the text box. Data should be stored and re-used after restarting the application.
To connect to the service, I use Alamofire. Help please, whether there is in this library any function to set the time limit, I request? And how to save the data? Save the new json file locally, or the data stored in an array, or use the database?
Thank you for your help.
I don't have an idea of setting a time limit, but you can explore the NSTimer function to check for that and if it is just a string that you want to store, you only need to use NSUserDefaults for that. It stores your data as a property list and you can access it from anywhere in the app at anytime.
Here's a link to help you setup NSUserDefaults.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Im looking to hide a post request name from the user, So they cannot post to a URL.
For example, Im looking for something that will avoid users checking the post request name and sending something to bypass the restrictions to insert into a database.
If the POST request comes from the user's browser, then they can inspect it. There is no way to avoid that.
Your only option is to make the POST request from somewhere else (such as your server). There is a good chance that you won't be able to do that (due to dependencies on the request coming from the user or included data they supply).
You mention "restrictions". If those restrictions are currently enforced with client side code: Enforce them with server side code.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am pretty new at learning Polymer, but I was wondering if I can use MongoDB as a back-end in Polymer. Maybe somehow using 'core-ajax' element.
I looked around for answers and I found one that suggested using Firebase element. : https://github.com/polymer/firebase-element
Is there any simpler way? Like the one nodeJS-express offers?
Also, can I use the json doc served by express using Mongo as an input JSON for 'core-ajax' of polymer? I tried doing it by throwing out the JSON output at certain route and passing that route as an URL to 'core-ajax'. But it failed. Why?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I test speed of my site loading and the result give me the answer for my site's low speed loading is .......
Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:
http://mydomain1.com/css/layout.css?v2.2
here how can i Remove the "?" from the above link and encode the parameter into the url.??
That message means you should do it like:
http://mydomain1.com/css/layout.css/v2.2
Using a / instead of a ?. How you achieve to parse this on server side depends on the technology you are using.