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

List an array in ionic view? Help

$
0
0

@leugim_ohlavrac wrote:

Hi guys,

How I list all elements of an array? it's only show the last one in my view:

My html:

< ion-item ng-repeat='item in entradas'>
[{{$index}}] - {{item}}
< /ion-item >

My .js:

    $scope.lista = function () {
    $scope.entradas = [];
    window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory,
        function (fileSystem) {
            var reader = fileSystem.createReader();
            reader.readEntries(
                function (entries) {

                    for (var i = 0; i < entries.length; i++) {

                        $scope.entradas = [entries[i].name];
                        console.log($scope.entradas);
                    }
                },
                function (err) {
                    console.log(err);
                }
            );
        },
        function (err) {
            console.log(err);
        }
    );
}

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49171

Trending Articles



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