C# MVC App using AngularJS
I am trying to display a list of values in a table that were originally entered in a text area.
Here is the workflow
User enters values in a text area as
A
B
C
When the user clicks on a button a modal window opens and should display A B C in a table .
I am trying to use angular to do this. I have tried the following:
<a class="btn btn-inverse pull-right" ng-click="arrangelist()">Arrange list</a>
<textarea id="letterlist" ng_model="letters"></textarea>
Also tried
@Html.TextAreaFor(model => model.letters, new { ng_model = "letters", @class = "width-100-percent", @rows = "7" })
And here is my modal window:
<div id=" arrangelist" class="modal hide fade" aria-hidden="true">
<table class="table">
<thead>
<tr>
<th>Letters</th>
</tr>
</thead>
<tbody>
<tr ng-animate="'table-anim'" ng-repeat="letter in letters">
<td>{{letter}}</td>
</tr>
</tbody>
</table>
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
Here is the JavaScript that opens the window:
$scope. arrangelist = function() {
return $('#arrangevideos').modal('show');
}
So the modal window opens and displays the table but no values are inside the table.
How can I pass the values from the text area to the table in the modal window using Angular