This repository was archived by the owner on Sep 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ // install : cordova plugin add https://github.com/pwlin/cordova-plugin-file-opener2
2+ // link : https://github.com/pwlin/cordova-plugin-file-opener2
3+
4+ angular . module ( 'ngCordova.plugins.fileOpener2' , [ ] )
5+
6+ . factory ( '$cordovaFileOpener2' , [ '$q' , function ( $q ) {
7+
8+ return {
9+
10+ open : function ( file , type ) {
11+
12+ var q = $q . defer ( ) ;
13+ cordova . plugins . fileOpener2 . open ( file , type , {
14+ error : function ( e ) {
15+ q . reject ( e ) ;
16+ } ,
17+ success : function ( ) {
18+ q . resolve ( ) ;
19+ }
20+ } ) ;
21+ return q . promise ;
22+
23+ } ,
24+
25+ uninstall : function ( pack ) {
26+
27+ var q = $q . defer ( ) ;
28+ cordova . plugins . fileOpener2 . uninstall ( pack , {
29+ error : function ( e ) {
30+ q . reject ( e ) ;
31+ } ,
32+ success : function ( ) {
33+ q . resolve ( ) ;
34+ }
35+ } ) ;
36+ return q . promise ;
37+
38+ } ,
39+
40+ appIsInstalled : function ( pack ) {
41+
42+ var q = $q . defer ( ) ;
43+ cordova . plugins . fileOpener2 . appIsInstalled ( pack , {
44+ success : function ( res ) {
45+ q . resolve ( res ) ;
46+ }
47+ } ) ;
48+ return q . promise ;
49+
50+ }
51+
52+ } ;
53+
54+ } ] ) ;
You can’t perform that action at this time.
0 commit comments