0

私はこれを持っています:

<div id="StopDialog" title="Stop Service">
    <form ng-submit="stopService()">
        <p>Why do you want to stop this service?</p>
        <input type="text" ng-model="stopReason" />
        <input type="submit" value="Stop" />
    </form>
</div>

HTML のフォームは、この関数を呼び出す必要があります。

$scope.stopService = function () {
        $("#dvProccessing").center();
        $("#dvProccessing").show();
        console.log($scope.stopReason);
        $http({
            type: "POST",
            url: "StopService?ServiceName=" + clickedService[1] + "&ServerName=" + clickedService[2] + "&Reason=" + $scope.stopReason,
            success: function (result) {
                $("#dvProccessing").hide();
                if (!result.IsSuccess) {
                    alert(result.Message);
                }
            },
            error: function () { $("#dvProccessing").hide(); }
        });
   };

ユーザーがフォームで入力した $scope.reason モデルと、関数の実行時に表示されるはずの処理 div がコンソール ログに表示されないため、ng-submit ディレクティブが stopService 関数を呼び出していないことはわかっています。表示されません。

これについての助けをいただければ幸いです。

4

0 に答える 0