Skip to content

Commit 2281a9a

Browse files
committed
made button controller optional. #9
1 parent 5acb005 commit 2281a9a

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
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.5",
3+
"version": "0.1.6",
44
"authors": [
55
"Rodik Hanukaev <[email protected]>",
66
"Topaz Bar <[email protected]>"

demo/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313

1414
<h2>Synchronous values</h2>
1515
<div class="container" ng-controller="SyncAppController">
16-
<json-editor schema="mySchema" startval="myStartVal" buttons-controller="SyncButtonsController" on-change="onChange($editorValue)">
16+
<json-editor schema="mySchema" startval="myStartVal" on-change="onChange($editorValue)"></json-editor>
17+
</div>
18+
19+
<h2>Buttons Controller</h2>
20+
<div class="container" ng-controller="SyncAppController">
21+
<json-editor schema="mySchema" startval="myStartVal" buttons-controller="SyncButtonsController">
1722

1823
<button type="submit" class="btn btn-success" ng-click="onSubmit($event)" ng-disabled="!isValid">
1924
<span class="glyphicon glyphicon-check"></span>

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.5",
3+
"version": "0.1.6",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/rodikh/angular-json-editor.git"

src/angular-json-editor.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ angular.module('angular-json-editor', []).provider('JSONEditor', function () {
3535
return dst;
3636
}
3737

38-
3938
}).directive('jsonEditor', ['$q', 'JSONEditor', function ($q, JSONEditor) {
4039

4140
return {
@@ -61,8 +60,6 @@ angular.module('angular-json-editor', []).provider('JSONEditor', function () {
6160
// Any exceptions thrown will probably be because the controller specified does not exist
6261
throw new Error('json-editor: buttons-controller attribute must be a valid controller.');
6362
}
64-
} else {
65-
throw new Error('json-editor: buttons-controller attribute must be specified.');
6663
}
6764

6865
}],

0 commit comments

Comments
 (0)