Posts

Showing posts from July, 2021

How to use Document/Window objetcts in SAP Spartacus?

  Here are the steps:   //import from spartacus   import  {    WindowRef , }  from   '@spartacus/core' ;   //constructor in your component/service   constructor (        protected   winRef :  WindowRef ,      ) {}     const   window  =  this . winRef . nativeWindow ; const document = this . winRef . document;   //use it like below  console.log( window . location . href);   //use it like below  const   form :  HTMLFormElement  =  this . winRef . document . querySelector ( 'form#loginForm' );              

Spartacus login form(spring security) submit to external application?

 1. login component HTML refer form tag:  <form  (ngSubmit)="submitForm()" [formGroup]="loginForm" id="loginForm" >   submitForm() is defined in login component ts file < form    (ngSubmit) = "submitForm()"   [formGroup] = "loginForm"   id = "loginForm"   >     < label   > {{ 'miniLogin.signInRegister' | cxTranslate | uppercase }} </ label >      < div   class = "form-group" >      < label >        < input          type = "email"          class = "form-control"          formControlName = "j_username"          placeholder = "{{ 'loginForm.emailAddress.placeholder' | cxTranslate }}"   ...