Hi 

I have a requirement to sort a table in my MVC razor UI. The table was 
generated using scaffolding option in MVC and bound to a model. The code 
looks something like below

@model 
IEnumerable<Avanade.Bureau.DataAccessLayer.DatabaseModel.SubscriptionType>

@{
    ViewBag.Title = "Subscriptions";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Subscriptions</h2>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Code)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr ng-repeat="table in Model | orderBy:predicate:reverse">
            <td>
                @Html.DisplayFor(modelItem => item.Code)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Subscribe", "Index", "Subscription", new 
{ id = item.Id }, null)
            </td>
        </tr>
    }

</table>
 

I want to use Angularjs to do sorting.All the examples that I have seen so 
far taken show examples of data that is hardcoded in the view. As you can 
see my view is bound to the model which gets the data from the database via 
the controller.  Could someone help. 

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to