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


TypeScript SqlStorage.set方法代码示例

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


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

示例1: newClicker

  public newClicker(name: string): string {
    const id: string = this.uid();
    const clicker: Clicker = new Clicker(id, name);

    // add the clicker to the service
    this.clickers.push(clicker);
    // add the id to the service (need to keep a separate reference of IDs so we can cold load clickers)
    this.ids.push(id);
    // save the clicker by id
    this.storage.set(id, JSON.stringify(clicker));
    // save the service's ids array
    this.storage.set('ids', JSON.stringify(this.ids));

    return id;
  }
开发者ID:udayakanth1122,项目名称:ionic2-karma-jasmine-travis-seed,代码行数:15,代码来源:clickers.ts

示例2: removeClicker

  public removeClicker(id: string): void {

    // remove clicker from the service
    this.clickers = this.clickers.filter((clicker: Clicker) => { return clicker.getId() !== id; });

    // remove from ids array
    this.ids = this.ids.filter((filterId: string) => { return filterId !== id; });

    // null id in db
    this.storage.remove(id);

    // update service's ids array
    this.storage.set('ids', JSON.stringify(this.ids));
  }
开发者ID:udayakanth1122,项目名称:ionic2-karma-jasmine-travis-seed,代码行数:14,代码来源:clickers.ts

示例3: doClick

 public doClick(id: string): void {
   const clicker: Clicker = this.getClicker(id);
   clicker.doClick();
   // save the clicker with updated click in storage
   this.storage.set(clicker.getId(), JSON.stringify(clicker));
 }
开发者ID:udayakanth1122,项目名称:ionic2-karma-jasmine-travis-seed,代码行数:6,代码来源:clickers.ts


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