Using ngCordova: "Can't find variable Camera"


Using ngCordova, I followed the code of the blog:

When execute the code, I have the following error: “Error: Can’t find variable: Camera”

Is Camera a variable that I should initialise somewhere ?

in my app.js I have :
var app = angular.module(‘starter’, [‘ionic’, ‘pouchdb’, ‘ngCordova’])

and the index.html

1 Like

The variable Camera is added by installing the camera plugin:

ionic plugin add

What I did before was : cordova plugin add
I correctly my plugins a folder named:

I executed the command: ionic plugin add
I got the message: Plugin “” already installed on ios.

Do I manually have to add the plugins/ in my index.html file ?

I am testing via the safari browser of an iphone and a webserver on my Desktop. I also noticed that cordova.js was not found

To be able to use camera, should I compile first and execute it as a standalone application on the iphone ? If so, is it the only way to test the camera functionality ?

Cordova.js is not available in the browser, cause its not needed. You don’t have access to native features like the camera in the browser, simply because they aren’t there.

Native features won’t work in the browser (aside a few exceptions that are implemented in browser engines, like geolocation)

Your last statement is partially right. If you want to test the native features, you’ll have to package your application in PhoneGap on your phone, or use an emulator on your computer and make use of the ionic emulate ios command.

This is a very old thread. Is it still the case ? (according to, the browser is supported. )