Skip to content

Commit fef24d4

Browse files
committed
Added JSONEditor provider for editor configuration (#8)
1 parent 9f6287c commit fef24d4

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-json-editor",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"authors": [
55
"Rodik Hanukaev <[email protected]>",
66
"Topaz Bar <[email protected]>"

dist/angular-json-editor.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-json-editor",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/rodikh/angular-json-editor.git"

src/angular-json-editor.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@ angular.module('angular-json-editor', []).constant('JsonEditorConfig', {
44
iconlib: 'bootstrap3',
55
theme: 'bootstrap3'
66

7-
}).directive('jsonEditor', ['$q', 'JsonEditorConfig', function ($q, JsonEditorConfig) {
7+
}).provider('JSONEditor', function () {
8+
var configuration = {};
9+
10+
this.configure = function (options) {
11+
angular.extend(configuration, options);
12+
};
13+
14+
this.$get = function ($window) {
15+
var JSONEditor = $window.JSONEditor;
16+
angular.extend(JSONEditor, configuration);
17+
return $window.JSONEditor;
18+
};
19+
20+
}).directive('jsonEditor', ['$q', 'JsonEditorConfig', 'JSONEditor', function ($q, JsonEditorConfig, JSONEditor) {
821

922
return {
1023
restrict: 'E',

0 commit comments

Comments
 (0)