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

Ionic select picture from galery

$
0
0

@taylormaster wrote:

Hi!
I need help, because i dont understund why dont work..., i try $cordovaImagePicker, $cordovaCamera but dont work.

<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>


<body ng-app="starter">
  <div ng-controller="ThisCtrl">
  <ion-nav-bar class="bar-energized"></ion-nav-bar>
  <ion-nav-view>
  <button class="button button-full button-positive" ng-click="selimg()">Select img</button>
  </ion-nav-view>  
  </div>
</body>

app.js

var app = angular.module('starter', ['ionic','ngCordova'])
 
app.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
});

app.controller('ThisCtrl', function($scope, $cordovaImagePicker) {

$scope.selimg = function () {
  var options = {
   maximumImagesCount: 10,
   width: 800,
   height: 800,
   quality: 80
  };

  $cordovaImagePicker.getPictures(options)
    .then(function (results) {
      for (var i = 0; i < results.length; i++) {
        console.log('Image URI: ' + results[i]);
      }
    }, function(error) {
      // error getting photos
    });
}
});

and install $cordovaImagePicker
in emulator and bluestack dont work...
thx

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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