How to do it...

The following are the instructions to add camera support:

  1. Start a blank project (for example, MyCamera) and go to that folder:
$ ionic start MyCamera blank
$ cd MyCamera
  1. Add the Cordova camera plugin and Ionic Native wrapper for the plugin using the following code:
$ ionic plugin add cordova-plugin-camera
$ npm install --save @ionic-native/camera
You should not use the cordova add command line directly; instead use ionic cordova plugin add

You should be able to see a new folder, cordova-plugin-camera, being added to the /plugins folder.

  1. Replace ./src/pages/home/home.html with the following code:
<ion-header>  <ion-navbar>    <ion-title>      Camera    </ion-title>  </ion-navbar></ion-header><ion-content padding> <ion-row class="center"> ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.