0

I created a project in MVC5 over Entity Framework and AngularJS. Now, what I want is to pass every database object to an MVC controller, in order to update their values. (ex: to modify a "customer" value) The following code doesn't work..

 <table class="table">                
                    <tr ng-repeat="r in customers">
                        <td>{{r.ID}}</td>
                        <td>{{r.LastName}}</td>
                        <td>{{r.FirstName}}</td>
                        <td>{{r.Phone}}</td>
                        <td>{{r.Email}}</td>
                        <td><a href="@Url.Action("Edit","Edit")?id={{r.ID}}"></a></td>
                    </tr>
                </table>

Please help me about how to pass r.ID to the razor above

@Html.ActionLink("Edit", "Edit", new { id = r.ID })
1

1 Answer 1

4

You need put ng- before href:

<a ng-href="@Url.Action("Edit","Edit")?id={{r.ID}}"></a>

Also ng-src for src attribute.

Sign up to request clarification or add additional context in comments.

1 Comment

You are awesome! Thank you!

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.