-
Notifications
You must be signed in to change notification settings - Fork 0
/
angularsrc.js
71 lines (61 loc) · 1.71 KB
/
angularsrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var dropApp = angular.module("dropApp",[]);
dropApp.controller('mainctrl', function($scope) {
$scope.logbut = true;
$scope.login = function() {
$scope.logbut = false;
$scope.template = {
name: 'login.html',
url: 'views/login.html'
};
};
//dropApp.controller('logintrl', function($scope) {
$scope.loginsignup = function() {
$scope.template = {
name: 'signup.html',
url: 'views/signup.html'
};
};
//});
});
dropApp.controller('homectrl', function($scope, $http) {
$scope.orderByField = 'name';
$scope.reverseSort = false;
$scope.data = {
rows: [{
name: 'John',
modified: 'Doe',
members: 30
},{
name: 'Frank',
modified: 'Burns',
members: 54
},{
name: 'Sue',
modified: 'Banter',
members: 21
}]
};
$scope.uploadbtn = function() {
console.log('upbtn');
document.getElementById('fileid').click();
console.log('clicked');
$('#fileid').change(function() {
console.log('processUpload');
var fd = new FormData();
fd.append('a',"123");
//fd.append('file', document.getElementById('fileid').files[0]);
var data = $.param({
a:'123'
});
console.log(fd);
var res = $http.post('/upload', data).then(function(){
//sucess
console.log('success');
}, function(){
//error
console.log('error');
});
console.log('submitted');
});
};
});