Commit 0fee5ee8 authored by Evren Kutar's avatar Evren Kutar

options request preflight önleme

liste sayfası düzenleme
parent 3533ee66
...@@ -32,8 +32,8 @@ staff.controller('StaffAddEditCtrl', function ($scope, $rootScope, $http, $log, ...@@ -32,8 +32,8 @@ staff.controller('StaffAddEditCtrl', function ($scope, $rootScope, $http, $log,
$rootScope.staffwfclear = 1 $rootScope.staffwfclear = 1
} }
Generator.get_form($scope.url, form_params).then(function (data) { Generator.get_form($scope.url, form_params).then(function (object) {
var d = data.data.forms; var d = object.data.forms;
// add form, schema and model to scope object // add form, schema and model to scope object
for (var key in d) for (var key in d)
$scope[key] = d[key]; $scope[key] = d[key];
...@@ -69,7 +69,8 @@ staff.controller('StaffListCtrl', function ($scope, $rootScope, Generator) { ...@@ -69,7 +69,8 @@ staff.controller('StaffListCtrl', function ($scope, $rootScope, Generator) {
} }
Generator.get_form('personel_duzenle_basitlestirilmis', form_params) Generator.get_form('personel_duzenle_basitlestirilmis', form_params)
.then(function (res) { .then(function (res) {
$scope.staffs = res.data; console.log(res);
$scope.staffs = res.data.employees;
}); });
}); });
......
<table class="table table-bordered table-responsive"> <table class="table table-bordered table-responsive">
<thead> <thead>
<tr> <tr>
<th>name</th> <!--<th>{{ staffs[0].key }}</th>-->
<th ng-repeat="(key,value) in staffs[0]">{{ key }}</th> <th ng-repeat="(key,value) in staffs[0].data">{{ key }}</th>
<th>action</th> <th>action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="staff in staffs"> <tr ng-repeat="staff in staffs">
<td><a ng-href="#/staff/{{staff.id}}">{{staff.name}}</a></td> <!--<td><a ng-href="#/staff/{{staff.id}}">{{staff.name}}</a></td>-->
<td ng-repeat="(key,value) in staff">{{value}}</td> <td ng-repeat="(key,value) in staff.data">{{value}}</td>
<td><a ng-href="#/staff/edit/{{staff.id}}">Edit</a></td> <td><a ng-href="#/staff/edit/{{staff.key}}">Edit</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
\ No newline at end of file
...@@ -15,7 +15,8 @@ app.config(['$httpProvider', function ($httpProvider) { ...@@ -15,7 +15,8 @@ app.config(['$httpProvider', function ($httpProvider) {
'request': function(config){ 'request': function(config){
// todo: delete console logs // todo: delete console logs
if (config.method == "POST"){ if (config.method == "POST"){
// to prevent OPTIONS preflight request
config.headers["Content-Type"] = "text/plain"
} else { } else {
} }
......
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