當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ionic-angular.ActionSheetController類代碼示例

本文整理匯總了TypeScript中ionic-angular.ActionSheetController的典型用法代碼示例。如果您正苦於以下問題:TypeScript ActionSheetController類的具體用法?TypeScript ActionSheetController怎麽用?TypeScript ActionSheetController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ActionSheetController類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: startNewGame

 startNewGame() {
   if(!this.setupData.playerOne || this.setupData.playerOne === "" || !this.setupData.playerTwo || this.setupData.playerTwo === "") {
     let actionsheet = this.actionsheet.create({
       title: 'You didn\'t specify both player\'s usernames. Their names will be \'Player One\' and \'Player Two\'. Is that okay?',
       cssClass: 'setup-actionsheet',
       buttons: [
         {
           text: 'No, I\'ll specify their names.',
           icon: 'md-alert',
           role: 'cancel'
         },
         {
           text: 'Yes, that\'s fine.',
           icon: 'md-checkmark-circle',
           role: 'destructive',
           handler: () => {
             this.setupData.playerOne = "Player One";
             this.setupData.playerTwo = "Player Two";
             this.newGame(this.setupData);
           }
         }
       ]
     });
     actionsheet.present();
   } else {
     this.newGame(this.setupData);
   }
 }
開發者ID:rraaij,項目名稱:keepstraight,代碼行數:28,代碼來源:setup.ts

示例2: options

  private options(songUrl: string, userUrl: string): void {

    let actions = this.actionCtrl.create({
      title: "Actions",
      buttons: [
        {
          text: "Visit on SoundCloud",
          icon: "link",
          handler: () => {
            window.open(songUrl);
          }
        },
        {
          text: "See who posted",
          icon: "person",
          handler: () => {
            window.open(userUrl);
          }
        },
        {
          text: 'Cancel',
          role: 'cancel',
          icon: "close",
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });

    actions.present();
  }
開發者ID:jgw96,項目名稱:Soundel,代碼行數:32,代碼來源:home.ts

示例3: abrirActionSheet

  abrirActionSheet() {
    let actionSheet = this.actionSheetCtrl.create(
      {
        title: 'Opções',
        buttons: [
          {
            icon: 'md-create',
            text: 'Opcão A',
            role: 'destructive',
            handler: () => {

            }
          },
          {
            text: 'Opcão B',
            handler: () => {

            }
          },
          {
            icon: 'md-exit',
            text: 'Cancelar',
            role: 'destructive',
            handler: () => {

            }
          }
        ]
      }
    );
    actionSheet.present();
  }
開發者ID:hlandim,項目名稱:Ionic3,代碼行數:32,代碼來源:action-sheet.ts

示例4: share

    share(concert) {
        let actionSheet: ActionSheet = this.actionSheetCtrl.create({
            title: 'Share via',
            buttons: [
                {
                    text: 'Twitter',
                    handler: () => console.log('share via twitter')
                },
                {
                    text: 'Facebook',
                    handler: () => console.log('share via facebook')
                },
                {
                    text: 'Email',
                    handler: () => console.log('share via email')
                },
                {
                    text: 'Cancel',
                    role: 'cancel',
                    handler: () => console.log('cancel share')
                }
            ]
        });

        actionSheet.present();
    }
開發者ID:cybriz,項目名稱:ionic-projects,代碼行數:26,代碼來源:favourite-detail.ts

示例5: openContact

  openContact(speaker: SpeakerModel) {
    let mode = this.config.get('mode');

    let actionSheet = this.actionSheetCtrl.create({
      title: 'Contact with ' + speaker.name,
      buttons: [
        {
          text: `Email ( ${speaker.email} )`,
          icon: mode !== 'ios' ? 'mail' : null,
          handler: () => {
            window.open('mailto:' + speaker.email);
          }
        },
        {
          text: `Call ( ${speaker.phone} )`,
          icon: mode !== 'ios' ? 'call' : null,
          handler: () => {
            window.open('tel:' + speaker.phone);
          }
        }
      ]
    });

    actionSheet.present();
  }
開發者ID:ddellamico,項目名稱:ionic-conference-app,代碼行數:25,代碼來源:speaker-list.ts

示例6: openSpeakerShare

  openSpeakerShare(speaker: SpeakerModel) {
    const actionSheet = this.actionSheetCtrl.create({
      title: `Share ${speaker.name}`,
      buttons: [
        {
          text: 'Copy Link',
          handler: () => {
            console.log(`Copy link clicked on https://twitter.com/${speaker.twitter}`);
            if (window['cordova'] && window['cordova'].plugins.clipboard) {
              window['cordova'].plugins.clipboard.copy(`https://twitter.com/${speaker.twitter}`);
            }
          }
        },
        {
          text: 'Share via ...',
          handler: () => {
            console.log('Share via clicked');
          }
        },
        {
          text: 'Cancel',
          role: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });

    actionSheet.present();
  }
開發者ID:ddellamico,項目名稱:ionic-conference-app,代碼行數:31,代碼來源:speaker-list.ts

示例7: showAccountSelector

  private showAccountSelector() {
    let options:any[] = [];

    _.forEach(this.accounts, (account: any) => {
      options.push(
        {
          text: (account.givenName || account.familyName) + ' (' + account.email + ')',
          handler: () => {
            this.onAccountSelect(account);
          }
        }
      );
    });

    // Cancel
    options.push(
      {
        text: this.translate.instant('Cancel'),
        role: 'cancel',
        handler: () => {
          this.navCtrl.pop();
        }
      }
    );

    let actionSheet = this.actionSheetCtrl.create({
      title: this.translate.instant('From BitPay account'),
      buttons: options
    });
    actionSheet.present();
  }
開發者ID:bitjson,項目名稱:copay,代碼行數:31,代碼來源:bitpay-card-intro.ts

示例8: showActionSheet

  showActionSheet()
  {
    let actionSheet = this.actionSheetCtrl.create({
      title: this.cpInfo.name,
      buttons: [{
        text: 'Credit Reviews',
        handler: ()=>{
          let navTransition = actionSheet.dismiss();

          //mock data
          let documents = [{"docName": "appraisal_sample1.docx", "docUrl": "www/mock/appraisal_sample1.docx"},
                          {"docName": "appraisal_sample2.pdf", "docUrl": "www/mock/appraisal_sample2.pdf"},
                          {"docName": "appraisal_sample3.xlsx", "docUrl": "www/mock/appraisal_sample3.xlsx"}];

          navTransition.then(()=>{
            //open the list of documents for the cp
            this.navCtrl.push(CounterpartyCaPage,
                { "counterpartyName": this.cpInfo.name, "documents": documents });
          });

          return false;
        }
      },{
        text: 'Cancel',
        role: 'cancel',
        handler: ()=>{
          ;
        }
      }]
    })

    actionSheet.present();
  }
開發者ID:letuthanhson,項目名稱:ionic,代碼行數:33,代碼來源:counterparty-info.ts

示例9: presentActionSheet

 presentActionSheet():void {
   let actionSheet = this.actionSheetCtrl.create({
     title: '',
     buttons: [
       {
         text: 'Get secured content',
         role: 'destructive',
         handler: () => {
           this.users.getSecuredData().subscribe(response => {
             console.log(response);
           })
         }
       },
       {
         text: 'Log out',
         handler: () => {
           localStorage.setItem('id_token', '');
           this.nav.push(LoginPage);
         }
       },
       {
         text: 'Cancel',
         role: 'cancel',
         handler: () => {
           console.log('Cancel clicked');
         }
       }
     ]
   });
   actionSheet.present();
 }
開發者ID:irenecamunag,項目名稱:ionic2-jwt-auth-example,代碼行數:31,代碼來源:home.ts

示例10: connectPolicy

  connectPolicy(){
    let actionSheet = this.actionSheetCtrl.create({
      title: 'Connect Policy Options',
      buttons: [
        {
          text: 'Connect To Last Device',
          handler: () => {
            console.log('Connect To Last Deviceclicked');
          }
        },
        {
          text: 'Connect To List',
          handler: () => {
            console.log('Connect To List clicked');
          }
        },
       
        {
          text: 'Cancel',
          role: 'cancel',
          handler: () => {
            console.log('Cancel clicked');
          }
        }
      ]
    });
 
    actionSheet.present();

  }
開發者ID:amitpmloginworks,項目名稱:HomeSpotUpdated,代碼行數:30,代碼來源:advanced.ts


注:本文中的ionic-angular.ActionSheetController類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。