当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Events.subscribe方法代码示例

本文整理汇总了TypeScript中ionic-angular.Events.subscribe方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Events.subscribe方法的具体用法?TypeScript Events.subscribe怎么用?TypeScript Events.subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ionic-angular.Events的用法示例。


在下文中一共展示了Events.subscribe方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: openPINModal

 private openPINModal(action): void {
   this.isModalOpen = true;
   this.events.publish('showPinModalEvent', action);
   this.events.subscribe('finishPinModalEvent', () => {
     this.isModalOpen = false;
     this.events.unsubscribe('finishPinModalEvent');
   });
 }
开发者ID:bitjson,项目名称:copay,代码行数:8,代码来源:app.component.ts

示例2: openFingerprintModal

 private openFingerprintModal(): void {
   this.isModalOpen = true;
   let isCopay = this.appProvider.info.nameCase == 'Copay' ? true : false;
   this.events.publish('showFingerprintModalEvent', isCopay);
   this.events.subscribe('finishFingerprintModalEvent', () => {
     this.isModalOpen = false;
     this.events.unsubscribe('finishFingerprintModalEvent');
   });
 }
开发者ID:bitjson,项目名称:copay,代码行数:9,代码来源:app.component.ts

示例3: constructor

 constructor(private appCtrl: App, private navCtrl: NavController, private navParams: NavParams, private events: Events, private badge: Badge, private topicService: TopicService, private utilService: UtilService, private messageService: MessageService) {
   this.tab = this.navParams.get('tab');
   this.params = {
     page: 1,
     tab: this.tab || 'all',
     limit: 20,
     mdrender: false
   }
   events.subscribe('messageCount', (data) => {
     this.messageCount = data;
   });
   events.subscribe('topicPush', (data) => {
     this.topics.unshift(data);
   });
   events.subscribe('user', (data) => {
     this.user = data;
   });
 }
开发者ID:lqxlcc,项目名称:Ionic2-CNodeClub,代码行数:18,代码来源:home.ts

示例4:

    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      // this.local.clear(); // use this when user logged out
      // One time Login

      this.local.get("siteConfig").then((value) => {
        if (value) {
          this.siteconfig.setConfig(JSON.parse(value));
          this.loadData();
          this.zone.run(() => {
            if (value) {
              this.rootPage = ListPage;

            } else {
              //this.rootPage = LoginPage;
            }
          });
        }
        else {
          this.rootPage = LoginPage;
        }
      });

      //End

      StatusBar.styleDefault();
      this.events.subscribe('login:success', (res) => {
        this.loadData();
      });
      this.uniteMenu.getMenu().then((value) => {
        this.pages = value;
      });
      this.events.subscribe('page:added', (res) => {
        this.loadData();
      });
      this.events.subscribe('page:removed', (index) => {
        this.uniteMenu.removeMenu(index[0]);
      });
      this.events.subscribe('page:updated', (res) => {
        this.uniteMenu.updateMenu(res[0]);
      });
    });
开发者ID:appcarvers,项目名称:joomla-articles-app,代码行数:43,代码来源:app.ts

示例5: constructor

  constructor(public app: IonicApp,public platform: Platform, public menu: MenuController, public events: Events, public data: DataService, public http: HttpService) {
    this.app = app;
    this.menu = menu;
    this.events = events;

    // set our app's pages
    this.pages = [
      { title: 'Accueil', component: HomePage, icon: 'calendar'},
      { title: 'Friends', component: HomePage, icon: 'log-in'},
      { title: 'Settings', component: SettingsPage, icon: 'person-add'},
      { title: 'Connexion', component: LoginPage, icon: 'log-in'},
    ];


    // get if user is logged, go the home, if not show login page OR tutorial
    data.get('isLogged').then((isLogged) => {
      if (!isLogged) {
          data.get('done_tutorial').then((done) => {
          if (!done)
            app.getComponent('nav').setRoot(TutorialPage);
          else
            app.getComponent('nav').setRoot(LoginPage);
        });
      }
      else {
        this.pages[3].title = "Deconnexion";
        app.getComponent('nav').setRoot(HomePage);
      }
    });

    // Register Events
    events.subscribe('user.login', (response) => {
      this.pages[3].title = "Deconnexion";
    });

    events.subscribe('user.logout', () => {
      this.pages[3].title = "Connexion";
    });

    // Register payement key
    if (typeof Stripe !== 'undefined')
      Stripe.setPublishableKey('pk_test_bZGpr8BL8ew6VjEz7i5Izb8G');
  }
开发者ID:vmarchaud,项目名称:share_eat_mobile,代码行数:43,代码来源:app.ts

示例6: constructor

 constructor(public navCtrl: NavController,
             public loader: RecipeService,
             public popoverCtrl: PopoverController,
             public events: Events) {
   this.loadRecipes()
   this.events.subscribe('refresh-recipes', () => {
     console.log('REFRESHING RECIPES')
     this.loadRecipes()
   })
 }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例7: constructor

  constructor(private nav: NavController, private navParam: NavParams, private events: Events) {
      this.geofence = this.navParam.get('geofence');

    console.log(Json.stringify(this.geofence));
    this.farmName = this.geofence.notification.text;
    events.subscribe('farm:details', (userEventData) => {
      // userEventData is an array of parameters, so grab our first and only arg
      this.farmName = userEventData[0].notification.text;
    });
  }
开发者ID:nisinha,项目名称:farmapp,代码行数:10,代码来源:farmdetails.ts

示例8: constructor

    constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http, public popoverCtrl: PopoverController, public events: Events, public loadingCtrl: LoadingController) {
        this.date = new Date();

        this.http.get("http://apollo_ror.slapps.fr/sources.json").map(res => res.json()).subscribe(data => {
            this.sources = [];


            //this.items = {};
            console.log(data);
            for(var i=0;i<data.length;i++){
                //this.items[data[i].name]=data[i].display;
                this.sources.push({
                    name: data[i].name,
                    display: data[i].display,
                });
            };
            this.fetchNews(this.date);
            /*
            this.http.get("http://apollo_ror.slapps.fr/news.json").map(res => res.json()).subscribe(data => {
                this.news = [];
                console.log(data);
                for(var i=0;i<data.length;i++){
                    this.news.push({
                        title: data[i].title,
                        source: data[i].source,
                        image_link: data[i].image_link,
                        datetime:new Date(data[i].date),
                        link:data[i].link
                    });
                };
                this.updateNews();
            });
             */
        });

        events.subscribe('date:updated', (date) => {
            this.fetchNews(date);
        });
        events.subscribe('sources:updated', () => {
            this.updateNews();
        });
    }
开发者ID:stevenluong,项目名称:apollo,代码行数:42,代码来源:list.ts

示例9: constructor

  constructor(public nav: NavController,
    public ns: NoteService,
    public events: Events) {

    this.loadNotes();

    events.subscribe("refreshNotes", () => {
      this.loadNotes();
    });

  }
开发者ID:ntancardoso,项目名称:noted,代码行数:11,代码来源:notes.ts

示例10: constructor

 constructor(public events: Events) {
     
     function createUser(user) {
         console.log('User created!');
         events.publish('user:created', user);
     }
     events.subscribe('user:created', (user) => {
       console.log('Welcome', user);
     });
     createUser({ name: 'Feidianbo' });
 }
开发者ID:feidianbo,项目名称:ionic2-demo,代码行数:11,代码来源:page3.ts


注:本文中的ionic-angular.Events.subscribe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。