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

How to display directory files in ionic using listDir() method

$
0
0

@VinodTillu wrote:

Am able to create and remove a directory but how to display the files of that directory on screen.
Am getting [object Obejct] on screen
Home.ts

listAllFiles(){
    this.platform.ready().then(() => {
      this.file.listDir(this.file.externalRootDirectory, "DirectoryFile")

        .then((listfiles) => {
          this.showFile=listfiles;
          console.log("Directory listeing" + this.showFile);

        })
        .catch((err) =>{
        alert(JSON.stringify(err));
      })
    })
  }

Home.html

 <ion-list>
          <ion-item *ngFor="let printValues of showFile">
          {{printValues}}
        </ion-item>
      </ion-list>

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>