上面的AngularJS 100记录未加载

时间:2018-11-13 18:46:27

标签: c# asp.net angularjs sql-server asp.net-ajax

c#代码

[WebMethod]
public static List<RestaurantSubMenuDTO> GetRestaurantSubMenus()
{
    List<RestaurantSubMenuDTO> restaurantMenus = new List<RestaurantMenuDTO>();
    restaurantMenus = APIFactory.ORestaurantSubMenu.GetByCountryId(Utility.Misc.SelectedCountry_Admin, Utility.LanguageResource.LanguageId_Admin);
    return restaurantMenus;
}

angularjs代码

function loadRestaurantSubMenus($rootScope, $scope, ajaxRequest, $timeout) {
    showWaiting();
    var request = ajaxRequest({
        method: "POST",
        url: "restaurantsubmenu.aspx/GetRestaurantSubMenus",
        data: {}
    });

    request.success(function (result) {
        $timeout(function () {
            console.log(result.d.Id);
            // alert(result.d);
            $scope.restaurantsubmenus = result.d;
            hideWaiting();
        }, 0);
    });
}

html代码

<tbody>
    <tr ng-repeat="rsm in restaurantsubmenus | orderBy:sortKey:reverse | filter:search:strict">
        <td>{{ $index + 1}}</td>
        <td>
            <img ng-src="../images/restaurantmenu/{{rm.ImageURL}}" height="50px" width="50px" />
        </td>
        <td>{{rsm.MenuItem}}</td>
        <td>{{rsm.RestaurantName}}</td>
        <td>{{rsm.IsHidePrice}}</td>
        <td>{{rsm.SellingPrice}}</td>
        <td>
            <a href="javascript:;" ng-click="editRestaurantMenu(rsm)"><i class="fa fa-edit"></i>Edit</a>
        </td>
        <td>
            <a href="javascript:;" ng-click="deleteRestaurantMenu(rsm.Id)"><i class="fa fa-remove"></i>Remove</a>
        </td>
    </tr>
</tbody>

0 个答案:

没有答案