Camera plugin not working


#1

Hello I have a problem with my simple camera integration.

getting console error like this ->

Unkown provider : $cordovaCamera

here’s my js.app code :

angular.module('starter', ['ionic'])

.controller('CamCtrl', function($cordovaCamera, $scope, $timeout, $q, $ionicPopup) {
$scope.takepic = function() {
$cordovaCamera.getPicture({})
.then(function(data) {
console.log('Camera data: ' + angular.toJson(data));
}, function(error) {
console.log('Camera error: ' + angular.toJson(data));
});
};
  
          $scope.showAlert = function() {
            $ionicPopup.alert({
              title: 'Success',
              cssClass: 'Calm',
              content: 'Hello World!!!'
            }).then(function(res) {
              console.log('Test Alert Box');
            });
          };



  
});

Thanks!


#2

Please use like:
In index.html file

  <!-- cordova script (this will be a 404 during development) -->
<script src="ng-cordova.min.js"></script>
  <script src="cordova.js"></script>

ng-cordova will before cordova.js

In app.js file

var app=angular.module('ionicApp', ['ionic','ngCordova'])