Reputation: 3836
I have very large form field and in last step I would like to create a summary so people can see what they wrote there. It wouldn't be a problem to do this only with values which users passed to inputs but I also want to show labels of inputs before value.
So when HTML in form is:
<label for="one">First one:</label>
<input id="one" type="text" ng-model="firstInput">
I want to have something like:
First one: firstInput.value
where firstInput.value
is just text which user wrote in input.
I've created basic schema for this: plunker
I do not have even idea how to accomplish that so I ask you for help.
EDIT
Actually as CanFil mentioned I can use (key, value)
inside ng-repeat
but it will display the ng-model
name which in my case sometimes is meaningless for user that's why I prefer labels.
Upvotes: 1
Views: 971
Reputation: 325
You can repeat json as key-value pair like;
(key, value) in inputs
your inputs json should be empty and you should bind your html inputs like;
inputs.firstinput
and of course use {{value}} for showing the value
Upvotes: 1