File tree Expand file tree Collapse file tree 3 files changed +8
-41
lines changed Expand file tree Collapse file tree 3 files changed +8
-41
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,13 @@ export class AppComponent {
2424 . then ( ( imageAsset : any ) => {
2525 this . cameraImage = imageAsset ;
2626 let that = this ;
27- imageAsset . getImageAsync ( function ( nativeImage ) {
27+ imageAsset . getImageAsync ( function ( nativeImage , ex ) {
28+ if ( ex instanceof Error ) {
29+ throw ex ;
30+ } else if ( typeof ex === "string" ) {
31+ throw new Error ( ex ) ;
32+ }
33+
2834 if ( imageAsset . android ) {
2935 // get the current density of the screen (dpi) and divide it by the default one to get the scale
3036 that . scale = nativeImage . getDensity ( ) / android . util . DisplayMetrics . DENSITY_DEFAULT ;
Original file line number Diff line number Diff line change 11{
2- "private" : false ,
3- "nativescript" : {
4- "id" : " org.nativescript.helloworldng"
5- },
62 "name" : " tns-template-hello-world-ng" ,
73 "main" : " main.js" ,
84 "version" : " 2.3.3" ,
9- "author" : " Telerik <support@telerik.com>" ,
10- "description" : " Nativescript Angular Hello World template" ,
11- "license" : " BSD" ,
12- "keywords" : [
13- " telerik" ,
14- " mobile" ,
15- " angular" ,
16- " nativescript" ,
17- " {N}" ,
18- " tns" ,
19- " appbuilder" ,
20- " template"
21- ],
22- "repository" : {
23- "type" : " git" ,
24- "url" : " git://github.com/NativeScript/template-hello-world-ng"
25- },
26- "homepage" : " https://github.com/NativeScript/template-hello-world-ng" ,
275 "android" : {
286 "v8Flags" : " --expose_gc" ,
7+ "markingMode" : " none" ,
298 "requireModules" : [" nativescript-camera" ]
30- },
31- "dependencies" : {
32- "nativescript-angular" : " 1.1.0" ,
33- "@angular/core" : " 2.1.0" ,
34- "@angular/common" : " 2.1.0" ,
35- "@angular/compiler" : " 2.1.0" ,
36- "@angular/http" : " 2.1.0" ,
37- "@angular/platform-browser" : " 2.1.0" ,
38- "@angular/platform-browser-dynamic" : " 2.1.0" ,
39- "@angular/forms" : " 2.1.0" ,
40- "@angular/router" : " 3.1.0" ,
41- "reflect-metadata" : " ~0.1.8"
42- },
43- "devDependencies" : {
44- "zone.js" : " ~0.6.21" ,
45- "nativescript-dev-typescript" : " ^0.3.2"
469 }
4710}
Original file line number Diff line number Diff line change 11import * as typesModule from "tns-core-modules/utils/types" ;
22import * as utilsModule from "tns-core-modules/utils/utils" ;
33import * as applicationModule from "tns-core-modules/application/application" ;
4- import * as imageSourceModule from "tns-core-modules/image-source/image-source" ;
54import * as imageAssetModule from "tns-core-modules/image-asset/image-asset" ;
65import * as trace from "tns-core-modules/trace/trace" ;
76import * as platform from "tns-core-modules/platform/platform" ;
87import * as permissions from "nativescript-permissions" ;
98
109let REQUEST_IMAGE_CAPTURE = 3453 ;
11- let REQUEST_REQUIRED_PERMISSIONS = 1234 ;
1210
1311export let takePicture = function ( options ?) : Promise < any > {
1412 return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments