StickyContent not working for Angular


Topic: StickyContent not working for Angular

josh.novak pro asked 6 years ago

I cannot get the StickyContent to work for my site at all with the Angular version. I'm using the latest version (7.1.0). It would help if the docs went into more detail about requirements for it to work (does it need a certain container etc) and it would be great if there was a demo or something.


Joao pro answered 6 years ago

Hi @josh.novak.

I was having some issues implementing the sticky directive myself. I wanted to get  a card to stick on the right side column of a row once the window reach it.  The way I got it to work was something like this:

<div class="row">

  <div class="col-8">

     ...

 </div>

 <div class="col-4">

     <div #cartStickySpacer ></div>
       <div mdbSticky sticky-after="#cartStickySpacer">

       <div class="card">
          ...
       </div>
 
      </div>

 </div>

Also the documentation was not very clear on this but since I was importing individual components & modules on my app instead of the full mdb module I had to add "StickyContentModule" to my imports on the parent module.

Let me know if this works out for you

Cheers,

Joao

 


fodxp answered 6 years ago

All - one way to provide sourcecode to mdb support -

1. create a new angular app

2. reproduce the problem in the app.component.html

3. create a zip (minus the node_modules folder). 

4. Upload it to google drive and share it with mdb-support

Ideally, we'd expect the mdb-support team to do this.. but this is what I have been doing to get my problem debugged and solved quickly;


Arkadiusz Idzikowski staff answered 6 years ago

Hello,

We will update our documentation with new examples.

Please provide more information on the problems you encountered when using mdbSticky.

Regards,

Arek


josh.novak pro answered 6 years ago

I'd like to provide some more information, but I can't because you guys didn't give enough info. I did what your docs said, which was add the "mdbSticky" directive to the element. It does nothing. I'm not sure if it's because it's nested, or if I have to do other things for it to work. I'm importing everything too, so that shouldn't be an issue.

My import line:

import { MDBBootstrapModulesPro, MDBSpinningPreloader } from 'ng-uikit-pro-standard';

Damian Gemza staff answered 6 years ago

Dear @josh.novak 

Could you please provide me with the code which you're using in your application? I would like to debug your problem with my application.

Without the code, I won't be able to help you well.

Best Regards,

Damian


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: Mac
  • Browser: Chrome
  • OS: Mac
  • Provided sample code: No
  • Provided link: No