Skip to content

Commit d9698f4

Browse files
committed
Working on angular sample
1 parent 791a3b2 commit d9698f4

File tree

3 files changed

+26
-9
lines changed
  • SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Web

3 files changed

+26
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
(function () {
1+
var abp = abp || {};
2+
(function (angular) {
3+
4+
if (!angular) {
5+
return;
6+
}
7+
8+
// 'abp' module ///////////////////////////////////////////////////////////
29

310
var abpModule = angular.module('abp', []);
411

5-
abpModule.filter('localize', function () {
6-
return function (input, localizationSource) {
7-
return abp.localization.localize(input, localizationSource);
12+
abpModule.factory('services.tasksystem.task', ['$http', function ($http) {
13+
return new function() {
14+
this.getTasks = abp.services.tasksystem.task.getTasks;
15+
16+
//Working on this code!
17+
//this.getTasks = function(input) {
18+
// return $http({
19+
// url: '/api/services/tasksystem/task/GetTasks',
20+
// method: 'POST',
21+
// data: JSON.stringify(input)
22+
// });
23+
//};
824
};
9-
});
25+
}]);
1026

11-
})();
27+
})(angular || undefined);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
var controllerId = 'sts.controllers.views.task.list';
33
var app = angular.module('app');
44

5-
app.controller(controllerId, ['$scope', function ($scope) {
5+
app.controller(controllerId, ['$scope', 'services.tasksystem.task', function ($scope, taskService) {
66
var vm = this;
77

8+
vm.tasks = [];
9+
810
vm.localize = abp.localization.getSource('SimpleTaskSystem');
911

1012
$scope.selectedTaskState = 0;
@@ -14,7 +16,7 @@
1416
});
1517

1618
vm.refreshTasks = function () {
17-
abp.services.tasksystem.task.getTasks({
19+
taskService.getTasks({
1820
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
1921
}).done(function (data) {
2022
$scope.$apply(function() {

SimpleTaskSystemSPA_AngularJs_EntityFramework/SimpleTaskSystem.Web/Views/Shared/_Layout.cshtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
<script src="~/Scripts/json2.min.js"></script>
5454
<script src="~/Scripts/jquery-2.1.1.min.js"></script>
5555
<script src="~/Scripts/jquery-ui-1.10.4.min.js"></script>
56-
<script src="~/Scripts/jquery.validate.min.js"></script>
5756
<script src="~/Scripts/jquery.blockUI.min.js"></script>
5857
<script src="~/Scripts/toastr.min.js"></script>
5958
<script src="~/Scripts/others/spinjs/spin.js"></script>

0 commit comments

Comments
 (0)