user5863037
user5863037

Reputation: 79

On-click Textarea box in Angular js

I am new to angular.js I want to know how to add the text area when onclick the image.

.......
.....
.....
</thead>
<tbody>
<tr ng-repeat="stu in Studentlist">
<td>{{stu.rollno}}</td>
<td>{{stu.name}}</td>
<td><img src="assets/img/reason.png"></td>
</tr>
.....
.....

My question is when I am click the reason.png,need to display the text area in below table.How to achive this in Angular js.

Upvotes: 0

Views: 1032

Answers (1)

Ruhul
Ruhul

Reputation: 1030

You can apply ng-click on your image as below

<td><img src="assets/img/reason.png" ng-click="showTextArea=true"></td>

And you can define your text area where you can use ng-show to show is when showTextArea is true.

i.e <textarea ng-show="showTextArea"></textarea>

Upvotes: 2

Related Questions