Skip to content

Commit bcb4db7

Browse files
committed
Working on...
1 parent 6ff9b60 commit bcb4db7

File tree

2 files changed

+41
-40
lines changed
  • SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Web

2 files changed

+41
-40
lines changed

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Web/Abp/Framework/scripts/libs/angular/abp.ng.js

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function(abp, angular) {
1+
(function (abp, angular) {
22

33
if (!angular) {
44
return;
@@ -9,59 +9,61 @@
99
var abpModule = angular.module('abp', []);
1010

1111
abpModule.config([
12-
'$httpProvider', function($httpProvider) {
12+
'$httpProvider', function ($httpProvider) {
1313
//$httpProvider.defaults.transformResponse.push(function (a) {
1414
// return a;
1515
//});
1616
}
1717
]);
1818

1919
abpModule.factory('abp.$http', [
20-
'$q', '$http', function($q, $http) {
21-
return function (options) {
20+
'$q', '$http', function ($q, $http) {
2221

23-
options.transformResponse = function(strData) {
24-
var data = strData && JSON.parse(strData);
25-
if (data) {
26-
if (data.targetUrl) {
27-
location.href = data.targetUrl;
28-
}
29-
30-
if (data.success === true) {
31-
return data.result;
32-
} else { //data.success === false
33-
if (data.error) {
34-
abp.message.error(data.error.message);
35-
}
36-
37-
if (data.unAuthorizedRequest && !data.targetUrl) {
38-
location.reload();
39-
}
40-
41-
if (data.targetUrl) {
42-
location.href = data.targetUrl;
43-
}
44-
45-
//TODO: ERROR
46-
return null;
47-
}
48-
} else { //no data sent to back
49-
return strData;
50-
}
51-
};
22+
//var defaultOptions = {
23+
// transformResponse: function (strData) {
24+
// if (!strData) {
25+
// return strData;
26+
// }
27+
28+
// var data = JSON.parse(strData);
29+
// if (!data) { //Needless check?
30+
// return strData;
31+
// }
32+
33+
// if (data.targetUrl) { //TODO: Check if it works and does not prevent return value!
34+
// location.href = data.targetUrl;
35+
// }
36+
37+
// if (data.success === true) {
38+
// return data.result;
39+
// } else { //data.success === false
40+
// if (data.error) {
41+
// abp.log.error(data.error.details);
42+
// abp.message.error(data.error.message);
43+
// }
44+
45+
// if (data.unAuthorizedRequest && !data.targetUrl) {
46+
// location.reload();
47+
// }
5248

53-
return $http(options);
49+
// return data;
50+
// }
51+
52+
// }
53+
//};
54+
55+
return function (options) {
56+
57+
return $http($.extend({}, defaultOptions, options));
5458
};
5559
}
5660
]);
5761

5862
abpModule.factory('services.tasksystem.task', [
59-
'abp.$http', function($http) {
60-
return new function() {
61-
//this.getTasks = abp.services.tasksystem.task.getTasks;
62-
63+
'abp.$http', function ($http) {
64+
return new function () {
6365
//Working on this code!
64-
this.getTasks = function(input) {
66+
this.getTasks = function (input) {
6567
return $http({
6668
url: '/api/services/tasksystem/task/GetTasks',
6769
method: 'POST',

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Web/App/Main/views/task/list.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
});
1717

1818
vm.refreshTasks = function () {
19-
//NOTE: Working on task service!
2019
taskService.getTasks({
2120
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
2221
}).success(function (data) {

0 commit comments

Comments
 (0)