1.0.4 • Published 8 years ago

toschi-ng-mat-browser v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

material setup

"theme.sass"
@import url( "https://fonts.googleapis.com/icon?family=Material+Icons")
@import '~@angular/material/theming'
@include mat-core()

$app-primary: mat-palette($mat-blue-grey)
$app-accent:  mat-palette($mat-light-blue, A200, A100, A400)
$app-warn:    mat-palette($mat-orange)
$app-theme: mat-dark-theme($app-primary, $app-accent, $app-warn)
@include angular-material-theme($app-theme)

setup app module

import {BrowserService, ToschiNgMatBrowser} from 'toschi-ng-mat-browser';
import {MatDialog} from '@angular/material';

@NgModule({
  
  imports: [
    BrowserModule,
    ToschiNgMatBrowser
  ],
  providers: [ MatDialog , BrowserService],
  bootstrap: [AppComponent]
})
export class AppModule { }

setup categories

inject service and make setup

"app.component.ts"

...

 constructor(public dialog: MatDialog, private browserService: BrowserService) {
    const base = '//your-file-api';
    this.browserService.setCategories([
      {
        id: 'get-images',
        name: 'ima ges',
        api: base + '/images',
        apiType: 'get',
        type: 'show',
        contentTypes: ['image']

      },
      {
        id: 'post-image',
        name: 'image uploader',
        api: base + '/file',
        apiType: 'post',
        type: 'uploader'
      }
    ]);
  }

  openBrowser() {
    const dialogRef = this.dialog.open(BrowserComponent, {width: '75%',data: {}});
    dialogRef.afterClosed().subscribe(result => {});
  }

add a include into the tsconfig.json if you are using angular v5.0.0 to avoid "is not part of the compilation output." errors

{
  "compileOnSave": false,
  "compilerOptions": {
     *****
  },
  "include": [
    "src/**/*",
    "node_modules/toschi-ng-mat-browser/index.ts"
  ]
}
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago