I’m new to AngularJS and i’m trying to imagine myself, how to do this scenario with angular:
Let’s say we have 20 difftent divs:
<div id="div0"></div>
<div id="div1"></div>
...
<div id="div19"></div>
Now, in some controller we are loading JSON, f.e.:
[
{label: "Lorem ipsum", position: "div0"},
{label: "Dolor", position: "div2"},
{label: "Lorem ipsum", position: "div8"}
]
Now, I want to render this elements, so the output will be, for the first JSON object:
{label: "Lorem ipsum", position: "div0"} -> <p>{{label}}</p> -> <p>Lorem</p>
and append this to #div0.
If I understand your question I think this is the answer:
and here’s the markup:
That’s pretty much all there would be to it.
EDIT
The OP would like to place the data into hard-coded HTML… so do to that you could do something like this:
Markup like so: