您好,我对某事感到有点困惑,当我发表我的表单数据没有发送到服务器,我检查了几次我的控制台,我无法理解发生了什么,这是我的控制器:
angular.module('app').controller('InstCtrl', ['$http', '$scope', '$state', 'InstService', function($http, $scope, $state, InstService) {
var parameters = {
name: $scope.name,
description: $scope.description,
email: $scope.email,
phone: $scope.phone,
website: $scope.website,
isActive: $scope.isActive
};
$scope.addInstitution = function(parameters) {
InstService.add(parameters);
console.log(parameters);
};
}]);
这是服务:
angular.module('app').factory('InstService', function ($http) {
var InstService = {};
InstService.add = function(parameters) {
return $http
.post('/api/v1/institutions/', parameters)
};
return InstService;
});
我用我的服务器上的前端和laravel 5 AngularJS。
的console.log回报不确定 和我$ http.post总是空的,因为在没有数据被发送到服务器。
它是什么,你在你的控制台,你不明白看? – Claies
对不起编辑我的帖子,包括那,谢谢。 – user3718908