Example of using Cordova Camera in a ionic2 application
Only tested in Android
If you don't have it already, first install ionic2 and cordova
$ npm install -g ionic@beta
$ npm install -g cordova
$ git clone https://github.com/marcusasplund/ionic2-camera-demo.git
$ cd ionic2-camera-demo
$ npm install
$ ionic build android
install .apk and test
(heads up: this project is written in typescript, if you want plain js, skip the flag --ts)
$ ionic start ionic2-camera-demo --v2 --ts
$ cd ionic2-camera-demo
$ ionic plugin add cordova-plugin-camera --save
$ tsd init
$ tsd install cordova --save
Add this row in file: typings/main.d.ts
/// <reference path="./cordova/plugins/Camera.d.ts"/>
download folder "app" from this project and replace folder "app" with this
$ ionic build android
install .apk and test
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。