Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using this inside angular.js #64

Open
vikasraok opened this issue Mar 24, 2017 · 1 comment
Open

using this inside angular.js #64

vikasraok opened this issue Mar 24, 2017 · 1 comment

Comments

@vikasraok
Copy link

vikasraok commented Mar 24, 2017

How to I initialise the schema with the json object from a api call? Angular doesn't let me access local files directly.

@bbpennel
Copy link
Member

If the json object is structured correctly (is generated from xsd2json), you can pass the editor a schema attribute with a function that just returns the json object, so something like:

var jsonObj = // get the object

$("#xml_editor").xmlEditor({
  schema: function() {
      return jsonObj;
    }
});

In needs to be in a method like that otherwise I recall it causing cyclical issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants