File
Implements
Metadata
| selector |
cx-login-register |
| templateUrl |
./login-register.component.html |
|
loginAsGuest
|
Default value : false
|
|
|
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'cx-login-register',
templateUrl: './login-register.component.html',
})
export class LoginRegisterComponent implements OnInit {
loginAsGuest = false;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit(): void {
this.loginAsGuest = this.activatedRoute.snapshot.queryParams['forced'];
}
}
<div class="register">
<p class="cx-section-title">
{{ 'loginForm.dontHaveAccount' | cxTranslate }}
</p>
<ng-container *ngIf="!loginAsGuest">
<a
[routerLink]="{ cxRoute: 'register' } | cxUrl"
class="btn btn-block btn-secondary btn-register"
>{{ 'loginForm.register' | cxTranslate }}</a
>
</ng-container>
<ng-container *ngIf="loginAsGuest">
<a
[routerLink]="{ cxRoute: 'checkoutLogin' } | cxUrl"
class="btn btn-block btn-secondary btn-guest"
>{{ 'loginForm.guestCheckout' | cxTranslate }}</a
>
</ng-container>
</div>
Legend
Html element with directive