개발

[ionic] 네이티브 팝업

지승준 2016. 2. 29. 15:52

http://developer.telerik.com/featured/adding-native-touches-hybrid-app/


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cordova plugin add cordova-plugin-dialogs
 
//alert
navigator.notification.alert(
    "Whassssssssuuuuupppp",             // the message
    function() {},                      // a callback
    "My Very Professional Application"// a title
    "OK"                                // the button text
);
 
//PROMPTS
navigator.notification.prompt(
    "Please give this order a name"// the message
    function( index ) {
        switch ( index ) {
            case 1:
                // The first button was pressed
                break;
            case 2:
                // The second button was pressed
                break;
 
        }
    },
    "Coffee World",     // a title
    [ "Ok""Cancel" ], // text of the buttons
    "My order"          // the default text
);
 
//CONFIRMATION DIALOGS
navigator.notification.confirm(
    "Delete the *whole* internet?"// the message
    function( index ) {
        switch ( index ) {
            case 1:
                // The first button was pressed
                break;
            case 2:
                // The second button was pressed
                break;
        }
    },
    "NSA Admin Panel"// a title
    [ "Yes""No" ]    // text of the buttons
);
 
navigator.notification.confirm(
    "Could you take a minute to rate my app?"// the message
    function( index ) {
        switch ( index ) {
            case 1:
                // The first button was pressed
                break;
            case 2:
                // The second button was pressed
                break;
            case 3:
                // The third button was pressed
                break;
        }
    },
    "Desperate for reviews",                   // a title
    [ "Sure""Remind me later""NO! STOP!" ] // text of the buttons
);
 
 
cs