0

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.

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

3 Comments

Many Thanks ! i need to one more doubt.No need to anything add for text area showing in controller ?
In controller, you can write $scope.showTextArea = false
or even in within you html it self you can initialize it using ng-init="showTextArea = false"

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.