当前位置: 首页>>代码示例>>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;未经允许,请勿转载。