Net
Type module
Sources
Items from Net can be imported/included and used via following ways.
/** * Import via main package * Access items like: am5.net.myVariable */import * as am5 from "@amcharts/amcharts5";
/** * Import via: Net.ts * Access items like: $net.myVariable */import * as $net from "@amcharts/amcharts5/Net";/** * Include via "index.js" * Access items like: am5.net.myVariable */Variables
Net does not have any variables.
Functions
load(url:string,
target?:A,
options?:INetRequestOptions)Returns
PromiseLoads a file from
urland returns aPromiseof the result. The promise is rejected, witherror: truein the result, if the request fails or its status is not 200.// Using await let response = await am5.net.load( "http://www.my.com/data.json" ); console.log( response.response ); // Using then() am5.net.load( "http://www.my.com/data.json" ).then( ( response ) => { console.log( response.response ); } );// Using then() am5.net.load( "http://www.my.com/data.json" ).then( function( response ) { console.log( response.response ); } );More info: Getting the most out of net.load utility
readBlob(blob:Blob)Returns
PromiseReturns textual representation of a Blob object.