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


TypeScript Content.scrollToBottom方法代碼示例

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


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

示例1: ionViewDidEnter

  //Function called once the view is full loaded
  ionViewDidEnter() {

    //Scroll to the bottom of the messages (Request below is for polling, not getting messages)
    this.content.scrollToBottom(this.scrollDuration);

    //Grab our user from localstorage
    let user = JSON.parse(localStorage.getItem(AppSettings.shushItemName));

    //Start polling to get messages
    let poll = this.appMessaging.conversationRequestPoll(user.access_token);

    //Get a reference to this
    let self = this;

    this.pollingRequest = poll.subscribe(function(success) {
      //Success!

      //Stop loading
      self.appNotify.stopLoading().then(function() {

        //Add our messages/Get our conversation
        self.appMessaging.conversations = success;

        //Update our conversations
        self.updateConversation();
      });
    }, function(error) {
      //Error!

      //Stop Loading
      self.appNotify.stopLoading().then(function() {
        //Pass to Error Handler
        self.appNotify.handleError(error, [{
          status: 404,
          callback: function() {
            //Pop back to the All conversations view

            self.navCtrl.pop();
          }
        }]);
      });

    }, function() {
      //Completed
    })
  }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:47,代碼來源:conversation.ts

示例2: updateConversation

  //Function to update our conversation
  updateConversation() {

    //Find and update our current conversation
    for (let i = 0; i < this.appMessaging.conversations.length; ++i) {
      if (this.convoId == this.appMessaging.conversations[i]._id) {

        //Update the conversation
        this.convo = this.appMessaging.conversations[i];

        //Break from the loop
        i = this.appMessaging.conversations.length;
      }
    }

    //Update the UI
    this.changeDetector.detectChanges();

    //Scroll to the bottom of the messages
    this.content.scrollToBottom(this.scrollDuration);
  }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:21,代碼來源:conversation.ts

示例3: scrollToBottom

 scrollToBottom(){
   this.content.scrollToBottom(300);//300ms animation speed
 }
開發者ID:thomas1511,項目名稱:ionicScrollProblem,代碼行數:3,代碼來源:hello-ionic.ts

示例4: ionViewDidEnter

 ionViewDidEnter() {
     this.content.scrollToBottom();
 }
開發者ID:SPL-201620,項目名稱:SocialBike,代碼行數:3,代碼來源:chat.ts


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