Unable to create component with outletref in Spartcus3.0.0-next.3

238 views Asked by At

I am trying to create a new paragraph component after "my account" dropdown after login. I tried to create a component after ng-reflect-position="SiteLogin" in b2b features.

Currently using Spartcus3.0.0-next.3. Where found there is syntax change in between 2.0 to 3.0.

Steps Created are: Created a angular component and its module was imported in app.module.ts

Imported import { OutletRefModule} from '@spartacus/storefront'; in New component module

Imported newly created component in app.component.html

Component code is

<ng-template [cxOutletRef]="SiteLogin" cxOutletPos="before" let-model>

 

Hi This new component

I couldn't see newly Imported paragraph component after SiteLogin component. In Same way in 2.0 able to get the component with cxOutletRef="testComponent" but in 3.0 there is no component shown.

Am I missing any code? Can anyone please help how to get component in 3.0

Thanks in Advance.

1

There are 1 answers

1
tobi-or-not-tobi On

There is no outlet available for the navigation entries inside the dropdown. The dropdown navigation itself is a cms component, and there's (currently) no more fine grained outlet for you to use.

Most customers however would control the navigations in the CMS. Perhaps that's something to consider.

Your code however should produce the template code before the SiteLogin page slot. You might face a small issue, since you seem to reference a variable SiteLogin rather than a string "SiteLogin". You'd need to remove the surrounding brackets from the cxOutletRef directive:

<ng-template cxOutletRef="SiteLogin" cxOutletPos="before" let-model>
  template content...
</ng-template>