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