传递在angularjs和web api中选择的值

时间:2016-12-12 12:07:58

标签: angularjs web asp.net-web-api

我有一个选项输入,用于在mvc应用程序中以html格式列出数据:

<div ng-app="RolesAp">
<div ng-controller="RolesController">
    <table class="table">
        <tr>
            <td class="post-content">
                <select ng-model="c.Title" ng-click="SendData(c)" ng-options="c.Title for c in Roles" id="ddlCategory"></select>
            </td>
        </tr>
    </table>
</div>

带控制器:

GetRls();
function GetRls() {
    RolesService.GetRls()
        .success(function (Rls) {
            $scope.Roles = Rls;
            console.log($scope.Roles);
        })
        .error(function (error) {
            $scope.status = 'Unable to load customer data: ' +      error.message;
             console.log($scope.status);
         });
 }


  RolesAp.factory('RolesService', ['$http', function ($http) {
var RolesService = {};
RolesService.GetRls = function () {
    return $http.get('/api/Process/Get');
};
return RolesService;
  }]);

如何使用web api将选定值传递给另一个表单?

感谢。

0 个答案:

没有答案