3

How can i pass the Url.action with parameter from angular object? refer to new { id ="{{item.Title}}", title = "" } section in code below. i cant do it like id ={{item.Title}} this renders it as an string.

 <div ng-app class="container-fluid">
        <div class="row-fluid">
            <div ng-controller="MostViewedToolController" class="span2">
                <ul class="nav nav-list">
                    <li><a href="#"><h4><b>Most Viewed</b></h4></a></li>
                    <li ng-repeat="item in tools">
                        <a href="@Url.Action("Index", "home", new { id ="{{item.Title}}", title = "" })"> {{item.Title}}</a>
                    </li>
                </ul>
            </div>
            @RenderBody()
        </div>
    </div>
Raju Kumar
  • 1,255
  • 3
  • 21
  • 39

2 Answers2

2

Please follow the below process, i have implemented it and it's working fine.

< a ng-href="@Url.Action("Index","home")?id={{item.ID}}&title={{item.Title}}"> link_name < / a>

yogesh
  • 41
  • 5
0

This fixed it.

<a ng-href="@Url.Action("Index", "home"){{item.ID}}/{{item.Title}}"> {{item.Title}}</a>
Raju Kumar
  • 1,255
  • 3
  • 21
  • 39