I added AngularJS to my existing web application and the Scrollpy stopped working. The following is the code after including AngularJS controllers.
<div class="container bs-docs-container">
<div class="row">
<div class="col-md-3" ng-controller="MenuController">
<div class="bs-sidebar hidden-print affix-top" role="complementary">
<ul class="nav bs-sidenav quickMenu">
<h3 class="quickMenuHead">Quick Menu</h3>
<hr></hr>
<li ng-repeat="item in menu" class="">
<a href="#{{item.mainType}}">{{item.mainName}}</a>
<ul class="nav">
<li ng-repeat="sub in item.submenu" class="">
<a href="#{{item.mainType}}-{{sub.subType}}">{{sub.subName}}</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
And the Scrollpy was enabled via JS:
$body.scrollspy({
target: '.bs-sidebar',
offset: 40
})
$window.on('load', function () {
$body.scrollspy('refresh')
})
Any comments why this is failing?
You just try this.
Then in HTML: