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


TypeScript Storage.get方法代码示例

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


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

示例1: constructor

 username:any;//用户是否登录
 constructor(
     private nav: NavController
     //private imagePicker:ImagePicker
 ) {
   this.user = {
     name:'',
     password:'',
     headface:'images/4.jpg'
   };
   this.local = new Storage(LocalStorage);
   //localStorage取值问题
   this.local.get('username').then( (res) =>{
   
       if( res ){
         this.user.headface = "images/" + res + ".jpg";
       }else{
         let modal = Modal.create(Login)
         modal.onDismiss(data => {
           console.log(data)
           this.user.headface = "images/" + data + ".jpg";
         })
         this.nav.present(modal)
       }
   })
 }
开发者ID:zhangxianmeng,项目名称:ionicDemo,代码行数:26,代码来源:userCenter.ts

示例2: getTable

 getTable(tableName: string): Promise<string> {
   return this.storage.get(tableName.toLowerCase())
     .catch( (reason) => {
       console.log('EntityManager.prototype.getTable():')
       console.dir(reason.err);
     });
 }
开发者ID:scunningham777,项目名称:Fantazaar,代码行数:7,代码来源:entity-manager.ts

示例3: constructor

  constructor() {
    this.storage = new Storage(SqlStorage, { name: SettingsService.DBNAME });

    this.storage.get(SettingsService.DBKEY).then(
      data => this.settings = JSON.parse(data||"{}")
    );
  }
开发者ID:clervens,项目名称:IonicTodoApp,代码行数:7,代码来源:settings-service.ts

示例4: initApp

  initApp() {

      this.locationService.refreshCurrentLocation();

      this.events.subscribe("loginSuccess", () => {
        this.rootPage = TabsPage;
      });

      // Check if existing user
      this.db.get("account").then(data => {
        if (data !== undefined) {

          //TODO Implement offline mode if there is no network connection
          this.accountService.tokenLogin(JSON.parse(data));

        } else {
          // Display intro page for new users w/c allows them to register/login
          this.rootPage = IntroPage;
        }
      },
        error => {
          console.log("DB Failure");
        }
      );
  }
开发者ID:eabquina,项目名称:blottr,代码行数:25,代码来源:app.ts

示例5: setupAuth

  private setupAuth() {
    //the af auth subscribe is slow to retrieve the key from local storage

    return this.storage.get('user_auth').then((user_data_string)=> {

      //debug until login is fixed

      this.InitUser({
        "uid": "HXACL4BGMoRx5MitbOl5v3FBSIC3",
        "displayName": "Ricky Rivera",
        photoURL: "https://lh3.googleusercontent.com/-Y08mWF2-A2M/AAAAAAAAAAI/AAAAAAAAH_o/RLFgPBcXft8/s96-c/photo.jpg"
      });
      this.HasUserRegistered = true;

      /*
       if (user_data_string) {
       try {
       let user_data = JSON.parse(user_data_string);
       this.InitUser(user_data);
       }
       catch (err) {
       }
       }

      //listen for login changes
      this.af.auth.subscribe((authState) => {
        if (authState && !this.loggedIn) {
          let auth = authState.auth;
          this.InitUser(auth);
          this.setUserAuthInStorage({uid: auth.uid, displayName: auth.displayName, photoURL: auth.photoURL});
        }
      });
      */
    });
  }
开发者ID:RickyTaterSalad,项目名称:FireIonic2,代码行数:35,代码来源:user-data.ts

示例6: load

    load() {
        this.local.get('user').then((value) => {
            if (value == null)
                this.username = ""
            else
                this.username = value
        })

        this.local.get('pass').then((value) => {
            if (value == null)
                this.password = ""
            else
                this.password = value;
        })

    };
开发者ID:idontgotit,项目名称:test,代码行数:16,代码来源:home.ts

示例7: function

    global.socket.on('api-member-login', function (data) {
      if (data.success) { // ถ้าเข้าระบบสำเร็จ
        storage.set('token', data.token);
        storage.get('page').then((page) => {
          if (page == 'signOut' || page == 'signIn') {
            storage.set('page', 'shopping');
            global.socket.emit('api', {
              token: data.token,
              module: 'system',
              action: 'screen'
            });

            global.socket.emit('api', {
              token: data.token,
              module: 'member',
              action: 'profile'
            });
          }
        });
      }
      else { // ถ้ามี Error
        let alert = alertCtrl.create({
          title: global.message.error,
          subTitle: global.message['err' + data.error],
          buttons: [global.message.ok]
        });
        alert.present();
      }
    });
开发者ID:RemaxThailand,项目名称:RemaxMobile,代码行数:29,代码来源:app.ts

示例8: constructor

  constructor() {
    this.storage = new Storage(SqlStorage, { name: 'todos' });

    this.storage.get('todos').then(
      todos => this.data = JSON.parse(todos||"[]")
    );
  }
开发者ID:clervens,项目名称:IonicTodoApp,代码行数:7,代码来源:todos-service.ts

示例9: constructor

  constructor(private navCtrl: NavController, private navParams: NavParams, private loadingCtrl: LoadingController) {
    this.global = this.navParams.get('global');
    this.orderNo = this.navParams.get('orderNo');
    
    this.global.isLoaded = false;
    let loader = this.loadingCtrl.create({
      content: "Please wait...",
    });
    loader.present();

    var timer = setInterval(() => {
      if(this.global.isLoaded) {
        clearInterval(timer);
        loader.dismiss();
      }
    }, 500);

    /*## รายละเอียดการชำระเงิน ##*/
    let storage = new Storage(LocalStorage);
    storage.get('token').then((token) => {
      this.global.socket.emit('api', {
        token: token,
        module: 'order',
        action: 'payment_data',
        orderNo: this.orderNo
      });
    });
  }
开发者ID:RemaxThailand,项目名称:RemaxMobile,代码行数:28,代码来源:payments-detail.ts

示例10: constructor

  constructor(private navCtrl: NavController, private navParams: NavParams, private loadingCtrl: LoadingController) {
    this.global = this.navParams.get('global');
    this.type = this.navParams.get('type');
    this.code = this.navParams.get('code');

    this.global.subData = {};

    this.global.isLoaded = false;
    let loader = this.loadingCtrl.create({
      content: this.global.message.pleaseWait+"...",
    });
    loader.present();

    var timer = setInterval(() => {
      if(this.global.isLoaded) {
        clearInterval(timer);
        loader.dismiss();
      }
    }, 500);

    let storage = new Storage(LocalStorage);
    storage.get('token').then((token) => {
      this.global.socket.emit('api', {
        token: token,
        module: 'curl',
        action: 'shipping',
        type: this.type,
        code: this.code,
        langCode: this.global.langCode
      });
    });
  }
开发者ID:RemaxThailand,项目名称:RemaxMobile,代码行数:32,代码来源:shipping-tracking.ts


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