-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
76 lines (69 loc) · 2.49 KB
/
app.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
70
71
72
73
74
75
76
angular.module('app', ['ngParse'])
.config(['ngParseProvider', function(ngParseProvider) {
var appId = 'q6XQ0eiusGQxbjResDckcaZNhM4h06a8LmIKSfdo',
restKey = 'kly8JbLTsQQLBzLyr6NvtxRYp8PnTo8B7PMLlgSt',
masterKey = 'at1pw2FxzaDFtoO1alUS8VWkTSBSNN9UPdjYZ5MV';
ngParseProvider.init(appId, restKey, masterKey);
}])
.controller('main', ['$scope', 'ngParse', function($scope, ngParse) {
// var FileObject = ngParse.File();
// $scope.upload = function(evt) {
// var file = document.getElementById('file').files[0];
// var picture = new FileObject({
// name: file.name,
// file: file
// });
// picture.save().then(function(v) {
// console.dir(v);
// var TestObject = ngParse.Object('TestObject'),
// object = new TestObject();
// object.save().then(function(v) {
// console.dir(v);
// object.file = picture;
// object.save().then(function() {
// console.dir(object);
// })
// });
// });
// "ffdf11d4-9cbb-4e43-84d0-f5da1e6af9c8-170.jpg"
// "8763285d-88a7-4523-973a-016ff6d9647b-170.jpg"
// reader.onload = function(evt) {
// console.dir(evt);
// var dataURL = evt.target.result;
// var mimeType = dataURL.split(",")[0].split(":")[1].split(";")[0];
// console.log(mimeType);
// };
// reader.readAsDataURL(file);
// }
var TestObject = ngParse.Object('TestObject');
var object = new TestObject();
object.query().then(function(data) {
console.dir(data);
// angular.forEach(data, function(v){
// v.remove();
// })
});
// $scope.createObject = function() {
// var object = ngParse.Object('TestObject');
// object.save(function() {
// query.find();
// });
// }
// $scope.removeObject = function(object) {
// object.remove(function() {
// console.log(query);
// })
// object = undefined;
// }
// var role = ngParse.Role({name: 'Test', ACL: {'*': {read: true}}});
// role.save();
// var User = ngParse.User();
// var user = new User();
// user.username = 'joujiahe';
// user.password = '5.ru8ck6';
// user.logIn().then(function() {
// user.remove().then(function() {
// console.dir(user);
// });
// });
}]);