Commit 6490a67e authored by Evren Kutar's avatar Evren Kutar

url oluştururken oluşan "undefined" hatası temizlendi

parent 29c0a60c
...@@ -18,7 +18,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $timeout, RESTURL ...@@ -18,7 +18,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $timeout, RESTURL
generator.get_form = function (url, getParams) { generator.get_form = function (url, getParams) {
if (getParams){ if (getParams){
// if form for edit then url will be // if form for edit then url will be
var params; var params = "";
for (var k in getParams) { for (var k in getParams) {
params += k + "=" + getParams[k] + "&"; params += k + "=" + getParams[k] + "&";
} }
...@@ -57,6 +57,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $timeout, RESTURL ...@@ -57,6 +57,7 @@ form_generator.factory('Generator', function ($http, $q, $log, $timeout, RESTURL
generator.submit = function ($scope) { generator.submit = function ($scope) {
$scope.$broadcast('schemaFormValidate'); $scope.$broadcast('schemaFormValidate');
//if ($scope.form.$valid) { //if ($scope.form.$valid) {
// todo: change post url, this is not correct!
$http.post('http://127.0.0.1:3000/api/add_student', $scope.model).then(function(res){$log.info(res);}); $http.post('http://127.0.0.1:3000/api/add_student', $scope.model).then(function(res){$log.info(res);});
//} //}
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment