Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

How to read file? Lools like there is many approaches

$
0
0

It looks like there is a couple of alternatives for working with files…
I did installation for Capacitor from here:

But I didn’t understand an example there… It looks unclear, like class description without name?
And then tried:

import { File } from '@ionic-native/file/ngx'
...
const fileReader = new File() 
const contentText = await fileReader.readAsText(
				'../content',
				'content.vtt'
			)

it causes an error :

./node_modules/@ionic-native/file/ngx/index.js
Module not found: Can't resolve '@angular/core' in '/home/aparus/Projects/vtt-phrasal-player/node_modules/@ionic-native/file/ngx'

Then I saw other approach with

but I didn’t try it yet.

Also I see the third approach?

Please, can someone explain shortly differences between them? Which should I choose, and how to implement it right?

What I want at the end? Some predefined folder, where I can store text files (subtitles) and media files (video, audio). For web, windows, android and iOS.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>