0

There is block HTML with article:

<div class="block">
   <span ng-click="edit()">Click</span>
   <div class="title">How to</div>
   <div class="text">Text</div>
</div>

When I call edit function ng-click="edit()" I call AJAX that returns data:

title
text

These data I set in $scope:

$scope.title = title;
$scope.text = text;

How I can create form with input, textarea instead HTML in .block? I neeed to switch on edit mode and display form for editing.

2
  • can you do a jsfiddle? Commented Sep 23, 2015 at 15:38
  • This is all what I have, I need to create HTML form on place instead title, text Commented Sep 23, 2015 at 15:41

1 Answer 1

1

You are essentially asking how to do a form. I would try going through some examples from the documentation eg. https://docs.angularjs.org/api/ng/directive/form

paying key attention to the ng-model="" tags to bind your data fields. Then the scope variables should automatically update your form.

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

Comments

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.