https://github.com/dimpu/ngx-file-manager
ngx-file-manager
https://github.com/dimpu/ngx-file-manager
Last synced: 3 months ago
JSON representation
ngx-file-manager
- Host: GitHub
- URL: https://github.com/dimpu/ngx-file-manager
- Owner: dimpu
- Created: 2018-10-26T17:18:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T04:54:56.000Z (about 7 years ago)
- Last Synced: 2025-02-15T23:42:15.243Z (11 months ago)
- Language: TypeScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NgxFileManager
# ngx-file-manager [](https://travis-ci.org/dimpu/ngx-file-manager)
Angular (>=2) component for rich text editor Quill
# Example
[Demo Page](https://dimpu.github.io/ngx-file-manager/)
### Installation
``` bash
npm install @dimpu/ngx-file-manager --save
```
### Sample
Include NgxFileManagerModule in your main module:
``` typescript
import { NgxFileManagerModule } from '@dimpu/ngx-file-manager';
@NgModule({
// ...
imports: [
NgxFileManagerModule
],
// ...
})
export class AppModule {}
```
Then use it in your component:
``` html
```
``` javascript
import { Component } from '@angular/core';
import { FileElement } from '@dimpu/ngx-file-manager';
@Component({
selector: 'sample',
template: require('./sample.html')
})
export class Sample {
public apiConfig: any = {
baseUrl: 'http://localhost:3100/api/',
listUrl: 'list',
uploadUrl: 'upload'
};
onFileUploaded(file: FileElement) {
console.log('uploaded file object', file);
}
fileSelected(file: FileElement) {
console.log('selected file object', file);
}
}
```
### API config
/api/list
```json
[{
basename: "file.png"
extension: ".png"
isFolder: false
name: "file"
thumb: "//localhost:3100/uploads/file.png"
},
{
basename: "file.png"
extension: ".png"
isFolder: false
name: "file"
thumb: "//localhost:3100/uploads/file.png"
}]
```
/api/upload
Request Method: POST
Form data
pic: (binary)
Response
```json
{
basename: "file.png"
extension: ".png"
isFolder: false
name: "file"
thumb: "//localhost:3100/uploads/file.png"
}
```
### Express server
clone this repo
```shell
npm run server.start
````