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


TypeScript authService.AuthService类代码示例

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


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

示例1: constructor

  constructor(private _router:Router,
              private _authService:AuthService) {
    this.show = {
      alert: false,
      smoothAlert:false
    };

    this._authService.getCurrentUser()
      .subscribe(success => {
        this.user = success;
      }, error => {});
  }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:12,代码来源:home.component.ts

示例2: constructor

  constructor(private _router:Router,
              private _authService:AuthService,
              private _formBuilder:FormBuilder) {

    this.userForm = this._formBuilder.group({
      'first_name': ['', Validators.required],
      'last_name': ['', Validators.required],
      'about': ['', Validators.required],
      'phone': ['', Validators.required],
      'age': ['', Validators.required]
    });

    this.show = {};

    // Initializes the current user
    this._authService.getCurrentUser()
      .subscribe(success => {
        // The request was a success
        this.user = success;
      }, error => {
        // Something went wrong
        console.log(error);
      });
  }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:24,代码来源:generalprofile.component.ts

示例3: sendNewSMS

 public sendNewSMS() {
   var email = this._routeSegment.getParam('phone');
   this._authService.resendConfirmEmail(email)
     .subscribe(res => {
       console.log('New email sent');
     });
 }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:7,代码来源:complete.component.ts

示例4: validataAuthToken

  public validataAuthToken() {
    let token = this._routeSegment.getParam('token');

    this._authService.validateToken(token)
      .subscribe(res => {

        this.alertText = 'Bekreftet!';

        this.toggle('alert');
        setTimeout(() => {
          this.toggle('alert');
          this._router.navigate(['login']);
        }, 2000)
      });
  }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:15,代码来源:auth.component.ts

示例5: update

  /*
   *  ==================================
   *    PUBLIC METHODS
   *  ==================================
   */

  // Update user information
  public update() {

    // Sets the profile to compleated, since all fields in form needs to be valid for this function to be triggered
    this.user.has_completed_profile = true;

    this._authService.update(this.user)
      .subscribe(success => {
        console.log("Success");

        this.alertOptions = {
          title: 'Oppdatert',
          showAccept: true,
          acceptText: 'Lukk',
          type: 'success',
          text: 'Din profil er nĂĽ oppdatert. Takk skal du ha.'
        };

        this.toggle('alert');

      }, error => {
      });
  }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:29,代码来源:generalprofile.component.ts

示例6: verifyCode

 public verifyCode(code:string) {
   this._authService.validateCode(code)
     .subscribe(success => {
       this._router.navigate(['front']);
     }, error => {});
 }
开发者ID:valdemarrolfsen,项目名称:tidbanken,代码行数:6,代码来源:complete.component.ts


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