Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have a series of comment inputs that repeat. When I start typing in one, all inputs are populated with the characters I am typing.

How do I have the text input value only populate in the text input I am typing into?

Here is what my template looks like:

<li ng-repeat="post in feed.posts" class="media media-clearfix-xs">
<form ng-submit="feed.addComment(post.id, post.comment_set)">
  <div class="input-group">
    <input ng-model="feed.desc" type="text" class="form-control" />
        <span class="input-group-btn">
         <button ng-click="submit()" class="btn btn-default"><i class="fa fa-comment-o"></i></button>
        </span>
</div>
</form> 
</li>
share|improve this question

You should have that desc property on post level instead of directly putting inside controller context feed(assuming feed is controller alias)

<input ng-model="post.desc" type="text" class="form-control" />
share|improve this answer

It should not , since you have a array where each object which deals with each line, change ng-model to be post.desc not feed.desc

<input ng-model="post.desc" type="text" class="form-control" />

DEMO

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.