Skip to content

Commit

Permalink
made button controller optional. #9
Browse files Browse the repository at this point in the history
  • Loading branch information
rodikh committed Nov 30, 2014
1 parent 5acb005 commit 2281a9a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-json-editor",
"version": "0.1.5",
"version": "0.1.6",
"authors": [
"Rodik Hanukaev <[email protected]>",
"Topaz Bar <[email protected]>"
Expand Down
7 changes: 6 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@

<h2>Synchronous values</h2>
<div class="container" ng-controller="SyncAppController">
<json-editor schema="mySchema" startval="myStartVal" buttons-controller="SyncButtonsController" on-change="onChange($editorValue)">
<json-editor schema="mySchema" startval="myStartVal" on-change="onChange($editorValue)"></json-editor>
</div>

<h2>Buttons Controller</h2>
<div class="container" ng-controller="SyncAppController">
<json-editor schema="mySchema" startval="myStartVal" buttons-controller="SyncButtonsController">

<button type="submit" class="btn btn-success" ng-click="onSubmit($event)" ng-disabled="!isValid">
<span class="glyphicon glyphicon-check"></span>
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-json-editor.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-json-editor",
"version": "0.1.5",
"version": "0.1.6",
"repository": {
"type": "git",
"url": "git://github.com/rodikh/angular-json-editor.git"
Expand Down
3 changes: 0 additions & 3 deletions src/angular-json-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ angular.module('angular-json-editor', []).provider('JSONEditor', function () {
return dst;
}


}).directive('jsonEditor', ['$q', 'JSONEditor', function ($q, JSONEditor) {

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

}],
Expand Down

0 comments on commit 2281a9a

Please sign in to comment.