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


TypeScript Storage.ready方法代碼示例

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


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

示例1: constructor

  constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public events: Events) {

    storage.ready().then(() => {
       storage.get("dbList").then((val) => {
         this.universities = val;
       })
     });
  }
開發者ID:ppoggi,項目名稱:OwlApp,代碼行數:8,代碼來源:favorites.ts

示例2: initStorage

  async initStorage() {
    await this.storage.ready()
    await this.storage.clear()

    const raw = await this.http.get('/assets/preload.json').toPromise()
    const data = raw.json()
    return Promise.all(
      Object.entries(data).map(([key, recipe]) =>
        this.storage.set(key, recipe)))
  }
開發者ID:,項目名稱:,代碼行數:10,代碼來源:

示例3: updateList

 updateList(){
   this.storage.ready().then(() => {
      this.storage.get("dbList").then((oldList) => {
        const storageHandler = new StorageHandler();
        const updatedList = storageHandler.updateUniversityList(this.item, oldList);         
        this.storage.set("dbList", updatedList);
        this.events.publish("dbList:update");
      })
    });
 }
開發者ID:ppoggi,項目名稱:OwlApp,代碼行數:10,代碼來源:details.ts

示例4: constructor

  constructor (

    storage: Storage

  ) {

    this.storage = storage;
    this.storage.ready().then(() => {
      this.init();
    });

  }
開發者ID:apollo-ng,項目名稱:governess,代碼行數:12,代碼來源:plugins.ts

示例5: constructor

 constructor(public navCtrl: NavController, universityService:UniversityService, storage: Storage ) {
     storage.ready().then(() => {
       storage.get('dbVersion').then((val) => {
         if(!(val instanceof UniversityListVersion))
           val = {index: 0};
         let dbObj:Container = universityService.getUniversities(val);
         this.universities = dbObj.dbList;
         storage.set('dbList', dbObj.dbList );
         storage.set('dbVersion', dbObj.dbVersion );
     })
   });
 }
開發者ID:ppoggi,項目名稱:OwlApp,代碼行數:12,代碼來源:home.ts

示例6: load

  /**
   * Load (async) all WaypointPath saved in the underlying storage
   */
  async load(): Promise<WaypointPath[]> {
    await this.storage.ready();

    let waypointsIds: Array<string> = await this.storage.get(SettingsKeys.WAYPOINTS) || [];
    let waypointsPromises: Promise<WaypointPath>[] = waypointsIds.map(wp => this.storage.get(wp));

    let waypoints = [];
    for (var i in waypointsPromises){
      waypoints[i] = await waypointsPromises[i];
    }

    return waypoints.map(waypointPath => WaypointPath.from(waypointPath));
  }
開發者ID:ianathompson,項目名稱:eDO_ui,代碼行數:16,代碼來源:waypoints.service.ts

示例7:

  this.events.subscribe("updateMenu", () => {
      this.storage.ready().then(() => {
        this.storage.get("userLoginInfo").then((userLoginInfo) => {

          if (userLoginInfo != null) {

            console.log("User logged in...");
            this.user = userLoginInfo.user;
            console.log(this.user);
            this.loggedIn = true;
          }
          else {
            console.log("No user found.");
            this.user = {};
            this.loggedIn = false;
          }

        })
      });


    })
開發者ID:arvac,項目名稱:woo,代碼行數:22,代碼來源:menu.ts

示例8: ionViewDidEnter

 ionViewDidEnter() {

    this.storage.ready().then(() => {
      this.storage.get("userLoginInfo").then((userLoginInfo) => {

        if (userLoginInfo != null) {

          console.log("User logged in...");
          this.user = userLoginInfo.user;
          console.log(this.user);
          this.loggedIn = true;
        }
        else {
          console.log("No user found.");
          this.user = {};
          this.loggedIn = false;
        }

      })
    })


  }
開發者ID:arvac,項目名稱:woo,代碼行數:23,代碼來源:menu.ts

示例9: ready

 public ready() {
   return this.storage.ready();
 }
開發者ID:Nodonisko,項目名稱:ionic-cache,代碼行數:3,代碼來源:cache-storage.ts


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