@wobius/folder
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

Easily add folder navigation to your Angular + Material project.

Import the Module:

import { FolderModule } from '@wobius/folder'

@NgModule({
    imports: [ FolderModule ]
})

Usage:

import { Component } from '@angular/core'
import { FolderDB } from '@wobius/folder'

@Component({
    template: `
        <button mat-raised-button (click)="fid.onNewFolder()">Add Folder</button>
        <folder-nav [settings]="fset" (walked)="cwd=$event" (created)="onNewFolder($event)" #fid></folder-nav>
        <div *ngFor="let f of folderList | folder : cwd.key : fset.group">
            <span (click)="fid.onWalk(f)">{{ f.name }}</span>
        </div>
    `
})
export class MyComponent {
    folderList:FolderDB[] = []
    fset = {title:'My Pages', group:'page'}
    cwd:FolderDB = {key:'', abspath:''}

    onNewFolder(f:FolderDB) {
        this.folderList.push(f)
        this.folderList = this.folderList.slice()
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @wobius/folder

Weekly Downloads

0

Version

6.0.1

License

ISC

Unpacked Size

14.7 kB

Total Files

16

Last publish

Collaborators

  • jeram