Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

How do I use filePath plugin?

$
0
0

@bspark wrote:

Hello.

I want to use writeFile (Ionic Native Plugin) and for that, I need to set a path where the file will be written(the application’s root directory in my case).

I read a filePath doc, but I can’t find how I really use it.

  constructor(
    public file: File) {
  }
  writeFilePractice(){
    let path: string;
    let content: 'content of file'
//    path = this.filePath.resolveNativePath('I think I should do something here');

    this.file.writeFile(path, 'file.txt', content)
    .then(_ => alert('success'))
    .catch( err => alert('err : '+ err));
  }

I know this is very basic question, but I’m wandering.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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