I am very new to angular.js and am having some trouble with a seemingly simple task.
I need to get the json below from a json file on a website, then place the keys (english, spanish, etc.) inside label tags in my html file, then load their corresponding values (0, 1, 3, 2, 1) into html range inputs.
The json file contains:
[{"english":0,"spanish":1,"german":3,"russian":2,"korean":1}]
The html produced after loading the json should look like:
<form>
<label>English</label>
<input type="range" min="0" max="4" value="ENGLISH_VALUE_RETRIEVED_FROM_JSON_FILE" >
<label>Spanish</label>
<input type="range" min="0" max="4" value="SPANISH_VALUE_RETRIEVED_FROM_JSON_FILE" >
<label>German</label>
<input type="range" min="0" max="4" value="GERMAN_VALUE_RETRIEVED_FROM_JSON_FILE" >
<label>Russian</label>
<input type="range" min="0" max="4" value="RUSSIAN_VALUE_RETRIEVED_FROM_JSON_FILE" >
<label>Korean</label>
<input type="range" min="0" max="4" value="KOREAN_VALUE_RETRIEVED_FROM_JSON_FILE" >
<input type="submit" text="Save">
</form>
Finally I want to hit Save on the form and have the values for the corresponding keys updated on the json file online.
What are all the files necessary (using MVC) to build this example? If your answer involves any code, can you please explicitly say which file to add the code to?
Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…