Project

General

Profile

1
var module = angular.module('transformUI', []);
2

    
3
module.controller('transformCtrl', function ($scope, $http) {
4
	$scope.outputRecord = '';
5
	$scope.error = {};
6
	
7
	$scope.transform = function(rule, s) {
8
		$scope.outputRecord = '';
9
		$scope.error = {};
10
		$http.defaults.headers.post["Content-Type"] = "application/json; charset=UTF-8";
11
		$http.post('transform/transform.do?rule=' + encodeURIComponent(rule), s).success(function(res) {
12
            	if(res) {
13
            		$scope.outputRecord = res;
14
            	} else {
15
            		$scope.error({
16
            			'message' : 'empty response',
17
            		});
18
            	}
19
		}).error(function(err) {
20
			$scope.error = err;
21
		});
22
				
23
	}
24
	
25
	$scope.showProfile = function(rule) {
26
		location.href = './isManager.do#/profile/' + encodeURIComponent(rule);
27
	}
28
	
29
});
    (1-1/1)