load

loads a list of files from a file or a server

promise load(string url,string|object format);
urlstringthe path to the data
formatstring|objectoptional, the data format ("json" by default; other values are "csv" or an object)
promisea promise of data loading

Example

vault.data.load("/files.json");

Details

The component will make an AJAX call and expect the remote URL to provide valid JSON data.

Data loading is asynchronous, so you need to wrap any after-loading code into a promise:

vault.data.load("../some/data").then(function(){
    // some after-loading code
});
See also
Back to top