Skip to content

Commit 4be0fc4

Browse files
committed
fixed indents
1 parent 2f6b5b7 commit 4be0fc4

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

demo/app.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

33
angular.module('demoApp', ['angular-json-editor'])
44
.controller('MyCtrl', function ($scope) {
5-
$scope.ctrlSchema = {
6-
type: 'object',
7-
properties: {
8-
name: {
9-
type: 'string',
10-
title: 'Item Name',
11-
required: true,
12-
minLength: 1
13-
},
14-
age: {
15-
type: 'integer',
16-
title: 'Age',
17-
required: true,
18-
min: 0
19-
}
20-
}
21-
};
5+
$scope.ctrlSchema = {
6+
type: 'object',
7+
properties: {
8+
name: {
9+
type: 'string',
10+
title: 'Item Name',
11+
required: true,
12+
minLength: 1
13+
},
14+
age: {
15+
type: 'integer',
16+
title: 'Age',
17+
required: true,
18+
min: 0
19+
}
20+
}
21+
};
2222

23-
$scope.startval = {
24-
age: 20
25-
};
23+
$scope.startval = {
24+
age: 20
25+
};
2626

27-
$scope.onSubmit = function () {
28-
var formData = $scope.editor.getValue();
29-
console.log('formData', formData);
30-
};
27+
$scope.onSubmit = function () {
28+
var formData = $scope.editor.getValue();
29+
console.log('formData', formData);
30+
};
3131
});
3232

3333
angular.element(window.document).ready(function () {
34-
angular.bootstrap(window.document, ['demoApp']);
34+
angular.bootstrap(window.document, ['demoApp']);
3535
});

src/angular-json-editor.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,52 @@ angular.module('angular-json-editor', [])
55
return {
66
restrict: 'A',
77
scope: {
8-
startval: '=',
9-
jsonEditor: '=',
10-
schemaUrl: '@',
11-
editor: '=',
12-
isValid: '='
13-
},
8+
startval: '=',
9+
jsonEditor: '=',
10+
schemaUrl: '@',
11+
editor: '=',
12+
isValid: '='
13+
},
1414
link: function (scope, element, attrs) {
15-
var config = {
16-
startval: scope.startval,
17-
iconlib: attrs.iconlib || 'bootstrap3',
18-
theme: attrs.theme || 'bootstrap3'
19-
};
15+
var config = {
16+
startval: scope.startval,
17+
iconlib: attrs.iconlib || 'bootstrap3',
18+
theme: attrs.theme || 'bootstrap3'
19+
};
2020

21-
if (scope.jsonEditor) {
22-
config.schema = scope.jsonEditor;
21+
if (scope.jsonEditor) {
22+
config.schema = scope.jsonEditor;
2323

24-
} else if (attrs.schemaUrl) {
25-
config.ajax = true;
26-
config.schema = {
27-
$ref: scope.schemaUrl
28-
};
24+
} else if (attrs.schemaUrl) {
25+
config.ajax = true;
26+
config.schema = {
27+
$ref: scope.schemaUrl
28+
};
2929

30-
} else {
31-
console.error('no schema specified.');
32-
}
30+
} else {
31+
console.error('no schema specified.');
32+
}
3333

34-
var editor = new JSONEditor(element[0], config);
34+
var editor = new JSONEditor(element[0], config);
3535

36-
// Attach the editor object to the parent scope, for easy access from a controller.
37-
if (attrs.editor) {
38-
scope.editor = editor;
39-
}
36+
// Attach the editor object to the parent scope, for easy access from a controller.
37+
if (attrs.editor) {
38+
scope.editor = editor;
39+
}
4040

41-
// scope.isValid holds the validation state of the entire form.
42-
// it is useful for disabling the submit button while the form isn't valid.
43-
if (attrs.isValid) {
44-
scope.isValid = false;
45-
editor.on('ready', function () {
46-
scope.isValid = (editor.validate().length === 0);
47-
editor.on('change', function () {
48-
scope.$apply(function () {
49-
scope.isValid = (editor.validate().length === 0);
50-
});
51-
});
52-
});
53-
}
41+
// scope.isValid holds the validation state of the entire form.
42+
// it is useful for disabling the submit button while the form isn't valid.
43+
if (attrs.isValid) {
44+
scope.isValid = false;
45+
editor.on('ready', function () {
46+
scope.isValid = (editor.validate().length === 0);
47+
editor.on('change', function () {
48+
scope.$apply(function () {
49+
scope.isValid = (editor.validate().length === 0);
50+
});
51+
});
52+
});
53+
}
5454
}
5555
};
5656
});

0 commit comments

Comments
 (0)