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


TypeScript storage.Storage类代码示例

本文整理汇总了TypeScript中@ionic/storage.Storage的典型用法代码示例。如果您正苦于以下问题:TypeScript Storage类的具体用法?TypeScript Storage怎么用?TypeScript Storage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: constructor

  constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public alertCtrl: AlertController, private WP: WoocommerceProvider) {
    this.newOrder = {};
    this.newOrder.billing = {};
    this.newOrder.shipping = {};
    this.billing_shipping_same = false;

    this.paymentMethods = [
      { method_id: "bacs", method_title: "Direct Bank Transfer" },
      { method_id: "cheque", method_title: "Cheque Payment" },
      { method_id: "cod", method_title: "Cash on Delivery" },
      { method_id: "paypal", method_title: "PayPal" }];

    this.WooCommerce = WP.init(true);

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

      this.userInfo = userLoginInfo.user;

      let email = userLoginInfo.user.email;
      let id = userLoginInfo.user.id;

      this.WooCommerce.getAsync("customers/"+id).then((data) => {

        this.newOrder = JSON.parse(data.body);

      })

    })

  }
开发者ID:arvac,项目名称:woo,代码行数:30,代码来源:checkout.ts

示例2:

	//登出
	signout(): void {
		var that = this;

		this.storage.remove('token').then(() => {
			that.navCtrl.setRoot(LoginPage);
		});
	}
开发者ID:qwb0920,项目名称:ionic-uuchat,代码行数:8,代码来源:setting.ts

示例3: getItem

 private getItem(KEY: string) {
     return this.storage.get(KEY).then((value) => {
         return value;
     }).catch((error) => {
         return error;
     })
 }
开发者ID:Margorah,项目名称:CharSheetNg2,代码行数:7,代码来源:storage.service.ts

示例4: addItem

 addItem(item) {
   return this.storage.get('items').then((items) => {
     items.push(item);
     this.refreshList$.emit(items);
     return this.storage.set('items', items);
   });
 }
开发者ID:Ismaestro,项目名称:Packing-Up,代码行数:7,代码来源:items.service.ts

示例5:

                  }).then(() =>{
                    this.storage.set("url",data.url).then(() =>{

                    }, errorstorage =>{
                      console.log(errorstorage);
                    });
                  }, erroreeliminar =>{
开发者ID:EnriqueTun23,项目名称:pescaderia,代码行数:7,代码来源:home.ts

示例6: get

  get(key: any) {

    let data;

    this.storage.get(key).then(res => data = res );
    console.log(data);
  }
开发者ID:alejo8591,项目名称:charla-git,代码行数:7,代码来源:storage-service.ts

示例7: addCategory

 addCategory(category) {
   return this.storage.get('categories').then((categories) => {
     categories.push(category);
     this.refreshList$.emit(categories);
     return this.storage.set('categories', categories);
   });
 }
开发者ID:Ismaestro,项目名称:Packing-Up,代码行数:7,代码来源:categories.service.ts

示例8:

 this.storage.get("pendingLogQueue").then((val) => {
   console.log("Pending queue: ")
   console.log(val)
   let pendingLog: { service: string, log: any, zone_name: string, program_name: string, module_name: string, log_name: string } = { service: null, log: null, zone_name: null, program_name: null, module_name: null, log_name: null }
   pendingLog.service = suffix
   pendingLog.log = filled_log
   pendingLog.zone_name = details.zone_name
   pendingLog.program_name = details.program_name
   pendingLog.module_name = details.module_name
   pendingLog.log_name = details.log_name
   this.storage.get("user_id").then((user_id) => {
     if (val == null || val == undefined) {
       let temp = {}
       temp[user_id] = [pendingLog]
       this.storage.set("pendingLogQueue", temp)
       this.events.publish("pendingLog:total", 1)
     } else {
       if (Array.isArray(val[user_id])) {
         val[user_id].push(pendingLog)
         this.storage.set("pendingLogQueue", val)
         this.events.publish("pendingLog:total", val[user_id].length)
       } else {
         val[user_id] = [pendingLog]
         this.storage.set("pendingLogQueue", val)
         this.events.publish("pendingLog:total", 1)
       }
     }
   })
 })
开发者ID:caom92,项目名称:Espresso,代码行数:29,代码来源:app.logs.ts

示例9:

 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.
   statusBar.styleDefault();
   splashScreen.hide();
   this.storage.get("logged").then(value=>this.rootPage = value? HomePage: LoginPage);
 });
开发者ID:milo2005,项目名称:HeladosIonic,代码行数:7,代码来源:app.component.ts


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