GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DRY code · ServiceStackApps/StackApis@8ac8ce8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/StackApis
    • default.cshtml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/StackApis/default.cshtml‎

Copy file name to clipboardExpand all lines: src/StackApis/default.cshtml
+6-31Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
}
66
<script>
77
var app = angular.module('soApp', []);
8-
98
app.controller('soCtrl', ['$scope', '$http', '$timeout',
109
function ($scope, $http, $timeout) {
1110
$scope.makeRequest = function (path) {
12-
$http.get(path)
13-
.success(function (response) {
14-
$scope.questionsResult = response.Results;
15-
});
11+
$http.get(path).success(function (response) {
12+
$scope.questionsResult = response.Results;
13+
});
1614
};
1715
1816
$('input,select').change(function () {
@@ -30,30 +28,9 @@
3028
}
3129
3230
$scope.titleSearchTimeout = null;
33-
$scope.$watch('titleSearch', function () {
34-
processInputChange();
35-
});
36-
37-
$scope.$watch('scoreSelect', function () {
38-
processInputChange();
39-
});
40-
$scope.$watch('scoreVal', function () {
41-
processInputChange();
42-
});
43-
$scope.$watch('viewsSelect', function () {
44-
processInputChange();
45-
});
46-
$scope.$watch('viewsVal', function () {
47-
processInputChange();
48-
});
49-
$scope.$watch('answersSelect', function () {
50-
processInputChange();
51-
});
52-
$scope.$watch('answersVal', function () {
53-
processInputChange();
54-
});
55-
$scope.$watch('orderBySelect', function () {
56-
processInputChange();
31+
var watch = ['titleSearch', 'scoreSelect', 'scoreVal', 'viewsSelect', 'viewsVal', 'answersSelect', 'answersVal', 'orderBySelect'];
32+
angular.forEach(watch, function (input) {
33+
$scope.$watch(input, processInputChange);
5734
});
5835
5936
function constructUrl(model) {
@@ -76,10 +53,8 @@
7653
$scope.viewsSelect = 'GreaterThan';
7754
$scope.answersSelect = 'GreaterThan';
7855
$scope.orderBySelect = 'Score';
79-
8056
$scope.makeRequest('/questions');
8157
}
82-
8358
]);
8459
</script>
8560
<div ng-app="soApp">

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.