mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-23 02:40:14 +01:00
feat(demo): add landing page with docs (#1951)
This commit is contained in:
parent
67c9587b87
commit
43cc3a1556
190 changed files with 15425 additions and 21 deletions
29
docs/app/@theme/services/toc-state.service.ts
Normal file
29
docs/app/@theme/services/toc-state.service.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface NgxTocElement {
|
||||
fragment: string;
|
||||
element: any;
|
||||
y: number;
|
||||
setInView(val: boolean);
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class NgxTocStateService {
|
||||
state: NgxTocElement[] = [];
|
||||
|
||||
add(el: NgxTocElement) {
|
||||
this.state.push(el);
|
||||
}
|
||||
|
||||
remove(el: NgxTocElement) {
|
||||
this.state = this.state.filter(e => e !== el);
|
||||
}
|
||||
|
||||
list(): NgxTocElement[] {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.state = [];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue