http post を使用してフォームを送信しようとしていますが、フォームに入力して続行ボタンを押しても何も起こりません。http 投稿は、Chrome のネットワーク タブでも発生しません。何か案は?私のコードは以下の通りです:
私の角度コントローラー:
$routeProvider.when('/member-reg',{
templateUrl: 'index.php/routers/member_reg',
controller: 'registerAsMember'
});
app.factory("memberRegistrationService", function($http, $location) {
return {
register: function(member_info) {
return $http({
method: 'POST',
url: 'index.php/home/member_reg',
data: { member_info: member_info }
});
}
}
});
app.controller('registerAsMember', function($http, $location, $scope, memberRegistrationService) {
$scope.member_info = { username: "", password: "",
firstname: "", lastname: "", email: "" };
$scope.member_reg_submit = function() {
memberRegistrationService.register($scope.member_info).success(function(data) {
if(data.success == true) {
model('hello world');
}
}).error(function(data) {
alert('error');
});
}
});
私の見解:
<div class="alert alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>Register as a Member ...</h4>
Fill out the form below and press continue when finished.
</div>
<form ng-submit="member_reg_submit">
<label>Key in your desired username below:</label>
<input autofocus ng-model="memberinfo.username" style="width: 200pt" type="text" placeholder="Username..." required><br>
<label>Key in your desired password:</label>
<input ng-model="memberinfo.password" style="width: 200pt" type="password" placeholder="Password..." required><br>
<label>Enter your firstname:</label>
<input ng-model="memberinfo.firstname" style="width: 200pt" type="text" placeholder="Firstname..." required><br>
<label>Type in your lastname below:</label>
<input ng-model="memberinfo.lastname" style="width: 200pt" type="text" placeholder="Lastname..." required><br>
<label>Your email address:</label>
<input ng-model="memberinfo.email" style="width: 200pt" type="text" placeholder="Email..." required><br>
<button type="submit" class="btn">Continue</button><br><br>
</form>