Skip to content

du-scrollspy not working with dynamic content #154

Open
@balasivagnanam

Description

@balasivagnanam

Thanks for this awesome plugin.

I am trying to use this with a list of navigation links and goes to a list of div with ids dynamically populated.

This is my code below,

<div class="row" id="pagewrap">
      <div class="col-md-3 xs-hidden sm-hidden">
        <ul class="components-left-bar" id="sidebar">
          <li ng-repeat="section in userneeds.sections" du-scrollspy="{{section.id}}"><a href="#{{section.id}}" du-smooth-scroll du-scrollspy>{{section.name}}</a></li>
        </ul>
      </div>
      <div class="col-md-9 col-sm-12 col-xs-12">
          <div class="component-sections" ng-repeat="section in userneeds.sections">
            <h3 class="component-section-title" id="{{section.id}}">{{section.name}}</h3>
            <div class="component-section">
              <div class="component-section-inner" ng-repeat="innersection in section.innersections">
                <div class="component-general">
                    <h3 class="section-title">{{innersection.header}}</h3>
                    <p>{{innersection.description}}</p>
                    <ul class="ext-links" ng-repeat="extlink in innersection.links">
                      <li><a href={{extlink.linkPath}}>{{extlink.linkContent}}<i class="fa fa-external-link"></i></a></li>
                    </ul>
                </div>
              </div>
              </div>
              </div>
            </div>
          </div>

I tried various combinations like

<a href="#{{section.id}}" du-smooth-scroll  du-scrollspy="{{section.id}}">{{section.name}}</a>
<a href="#{{section.id}}" du-smooth-scroll  du-scrollspy>{{section.name}}</a>
<li ng-repeat="section in userneeds.sections" du-scrollspy="{{section.id}}"><a href="#{{section.id}}" du-smooth-scroll du-scrollspy>{{section.name}}</a></li>

but no luck.

I found this similar plunker and I see it not working.
Not sure what is going wrong here.

http://plnkr.co/edit/RlNCNvOQAc1hmoCPlTTo?p=preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions