1. Download the JS library and add it to the www directory of the Ionic 2 application
3. In every TS file in which you want to use the library, declare a variable of type any and with the name of the function from the 3rd party library – to act as a placeholder for the 3rd party JS library. During compilation, the real 3rd JS library is not visible, so any direct references to it will cause errors unless there is such a placeholder as shown here. Because the 3rd party library is loaded by the index.htm- the main page in the single page application – its functions will always be available (no lazy loading) and the references to the placeholder become references to the real library as a result.
The next figure shows how I did this for the exif library. Its main object is called EXIF, so my placeholder has that name. In the typescript function I can refer to functions that I know exist on EXIF – and I do not get compilation errors (nor of course do I get code completion or type safety). At runtime the references to EXIF are satisfied because then the exif.js file has been loaded.
hii i have appended data tables data from external js file. and on it i have action column edit having router link. but my routerlink was not working from that datatable action append how can i fix it ???
Sorry for the delay.
Thnak you Lucas
HI Lucas, thank you for your tutorial.
How can I use the exif library for the images I have in my storage? I have the file://sameimage.jpg so it is not an url. But this library seems go only for urls.
You can feed a buffer (which contains a Byte array with the image) to the exif function.
Comments are closed.