There are two ways to save images. 1) store image in database by converting it to binary format. 2) copy image in your project folder then save image path in table. ------- 1st way with front end angular------ pass uploaded file in "handleFileInput" function. saveImage ( files : FileList ) { var file : File = files . item ( 0 ); var myReader : FileReader = new FileReader (); myReader . onloadend = ( e ) => { this . image = myReader . result ; } myReader . readAsDataURL ( file ); //convert to base64 ends } now you will get binary format image in this.image variable. save this converted image directly to database through API. ------2nd way with api nodejs------ we can use "multer" to copy file in project folder. const multer = require ( 'multer'...
There are two most popular library for javascript to export data with excel sheet. 1) xlsx library 2) exceljs library If you would like to export simple data without changing its style then xlsx is perfact, but if you would like to change style before export then exceljs is perfect for JavaScript frameworks. Lets create an example with exceljs library to export data by changing style and colors for angular. Step 1: Install "exceljs" library npm install exceljs Step 2: Install "file-saver" library to save excel file. npm install file-saver Step 3: Import "exceljs" and "file-saver" library to your component. import * as ExcelJS from 'exceljs/dist/exceljs.min.js' ; import { saveAs } from 'file-saver' ; Step 4: Now create function in your component to export Data. exportExcel () { const workbook = new ExcelJS . Workbook ()...
step 1. first Install npm install capacitor-resources -g step 2. add bellow code to your package.json "scripts": { ... "resources": "capacitor-resources -p android,ios" } step 3. Now Add your icon.png (1024x1024 px) and splash.png (2732x2732 px) in resources folder. Create new resources folder if its is not exists at the same location where package.json exists. step 4. Now run "npm run resources" command and that's it.
Comments
Post a Comment