src-rx/src/components/Utils.js
/**
     * Generate the json file on the file for download.
     * @param {string} filename file name
     * @returns {object} json structure (not stringified)
     */
Generate the json file on the file for download.
@param {string} filename file name
@returns {object} json structure (not stringified)
Generate the json file on the file for download . @param { string } filename file name @returns { object } json structure ( not stringified )
static generateFile(filename, json) {
        let el = document.createElement('a');
        el.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(json, null, 2)));
        el.setAttribute('download', filename);
        el.style.display = 'none';
        document.body.appendChild(el);
        el.click();
        document.body.removeChild(el);
    }
static generateFile ( filename , json ) { let el = document . createElement ( 'a' ) ; el . setAttribute ( 'href' , 'data:application/json;charset=utf-8,' + encodeURIComponent ( JSON . stringify ( json , null , 2 ) ) ) ; el . setAttribute ( 'download' , filename ) ; el . style . display = 'none' ; document . body . appendChild ( el ) ; el . click ( ) ; document . body . removeChild ( el ) ; }
Generate the json file on the file for download.
Generate the json file on the file for download .