GithubHelp home page GithubHelp logo

ng-jsoneditor's People

Contributors

albert5287 avatar angular-tools avatar baslr avatar crystian avatar minutephp avatar xshen2026 avatar zeroasterisk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-jsoneditor's Issues

User shouldn't be able Insert fields when onEditable option is false

Set onEditable to false.

    $scope.obj = {
        data: json, 
        options: {
            mode: 'tree',
            onEditable: function(){return false;}
            }
     };

Click on the box [ ] to the left of a key and then select insert. Right now, a blank field and value are inserted. Warning signs are displayed without any capabilities to resolve since json is readonly.

image

diff or synch between 2json files

Hello there, any chance to get a example to see differences between 2 json files on Angular ? Or at least to have synch between 2 json files under Angular ?
Regards

Request Issue for the new release

So, guys how look your plans (month/year) for new release version to Bower? Direct usage of ng-jsoneditor:master as a version for bower a bit danger for our project :)
Thanks!

Abililty to Suppress Errors

It would be very useful to have an option to suppress errors so that the console does not get cluttered up (example error message below). These errors are thrown while the user is typing and they add up quickly.

Error: Parse error on line 8:
...": true, "test" "Created": "2016-01-
---------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
at Object.parse (jsoneditor.js:6586)
at Object.validate (jsoneditor.js:1620)
at Object.parse (jsoneditor.js:1476)
at JSONEditor.textmode.get (jsoneditor.js:1408)
at ng-jsoneditor.js:32
at angular.js:17918
at completeOutstandingRequest (angular.js:5552)
at angular.js:5829

Disable editing of keys

Hi,
I have a predefined json where user can only update the values of keys. Can I disable editing of the keys in a json

Not working with angular 1.4.6

<div name="json"
                     class="col-md-12"
                     id="json"
                     ng-model="json"
                     options="options"
                     ng-jsoneditor
                     style="height: 300px"></div>
$scope.options = {
      mode: 'code',
      modes: ['code','view'], // allowed modes['code', 'form', 'text', 'tree', 'view']
      error: function (err) {
        alert(err.toString());
      }
    };
    $scope.json = {
      test: 123
    };

    $timeout(function () {
      $scope.json = {
        test: 111
      };
    }, 1000)

Editor always shows empty Object: {}
And don't reflecting to any change

Error switching modes when using custom ace editor

JSONEditor allows you to specify a custom ace editor. However, if you do this, then ng-jsoneditor doesn't switch between code and tree mode correctly. For example, if you start in tree mode, and try to switch to code mode, you need to select code mode twice to make the switch. It's pretty clear that code mode is being rendered by JSONEditor, but then is being switched quickly back to tree mode the first time.

I modified the jsfiddle to recreate the issue: http://jsfiddle.net/sd3at5ek/10/

I'm happy to look into it, but thought I'd see if the solution seems clear to you before looking more closely!

Ace broken in code mode?

I'm getting a bit strange behavior when editing in code view mode. I place the caret and start typing, and the characters appear approx 20 chars before the caret, at a bit random position. When editing a string, the characters can get out of the string, so the json structure is damaged too eventually at a ~random spot. ...

Any ideas what might be causing this?

FF and chrome produce the same behavior for me.
Styling seems not to matter either, ...
jsoneditor 5.9.4
angularjs 1.6.6

editing a value in tree mode causes collapse

I'm trying to track down a weird behavior where typing into the value of a field causes the "tree" mode to collapse and leaves me unable to see the field where I'm typing. Has anyone seen this or does anyone understand what might cause this ? This does not happen in "text" mode.

I'm pretty sure this is related to the "timeout" value in the options. If I set that to say 1000mS then the collapse doesn't occur until after 1000ms.

New release?

Could a new version be released to bower? Would be nice to have the latest with the pr for #12 be published.
Maybe v1.1.0?

Rename this to angular-js-tools

Hi,

Please rename it to angularjs since it belongs to angular 1.x.
If possible, please change ng as well, as its recommended to not use ng

Cursor in the wrong place?

I'm wondering what I missed here, but the cursor is like 4 or 5 spaces to the right of where I'm actually typing. Any idea what might be causing that?

screen shot 2016-12-19 at 11 51 00 am

Error handling not functional

Providing an options.error callback does not seem to work. A workaround so far has been to hook error checking onto the ace editor with ng-jsoneditor="editorLoaded". But if I switch modes to tree and then back, it's gone since editorLoaded only fires the first time. Any thoughts?

$scope.editorLoaded = function(jsonEditor) {
  console.log('[json editor loaded]');
  $scope.editor.instance = jsonEditor;

  //TODO: we have a problem, this only fires once, so the error handler only gets attached the first time :(
  $timeout(function() {
    if ($scope.editor.options.mode === 'code') {
      _initErrorHandler(jsonEditor);
    }
  });
};

var _initErrorHandler = function(jsonEditor) {
  console.log('======= initializing error handler ===');
  jsonEditor.editor.getSession().on('change', function() {
    var debounce;
    $timeout.cancel(debounce);
    debounce = $timeout(function() {
      return $scope.$apply(function() {
        try {
          jsonEditor.get();
          console.log('jsonEditor', 'no errors in edited content');
          $scope.error = false;
        } catch (_error) {
          console.log('jsonEditor', 'editor contents not valid json');
          $scope.error = _error;
        }
      });
    }, 300);
  });
}

Search function not work correctly

on the search field, input some thing, then click 'Enter' on the keyboard, the result is correctly displayed, then clean the search field, and 'Enter', cannot restore the tree?
image

image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.