Directive to automatically generate a table of contents.
- Angular
- jQuery
Start by including the library as a dependency to your Angular app.
angular.module('DemoApp', ['angular-toc']);
Then in your HTML add a directive where you want to add the table of contents
The directive has one attribute:
Attribute | Value |
---|---|
selector |
Any selector that will work with jQuery. eg: li , .item h2
|
<bd-toc selector=".item h2"></bd-toc>