Skip to content

Commit

Permalink
feat: provider to configure (#435)
Browse files Browse the repository at this point in the history
* feat: provider to configure

* chore: update jsdoc
  • Loading branch information
kukhariev committed May 22, 2023
1 parent e2ace3a commit cf2f974
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/uploadx/lib/uploadx.provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Provider } from '@angular/core';
import { UPLOADX_OPTIONS, UploadxOptions } from './options';

/**
* Provides configuration options for standalone app.
*
* @example
* ```ts
* bootstrapApplication(AppComponent, {
* providers: [
* provideUploadx({
* endpoint: uploadUrl,
* allowedTypes: 'video/*,audio/*',
* maxChunkSize: 96 * 1024 * 1024
* })
* ]
* });
* ```
*/
export function provideUploadx(options: UploadxOptions = {}) {
const providers: Provider[] = [
{
provide: UPLOADX_OPTIONS,
useValue: options
}
];
return providers;
}
1 change: 1 addition & 0 deletions src/uploadx/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export * from './lib/uploaderx';
export * from './lib/uploadx-drop.directive';
export * from './lib/uploadx.directive';
export * from './lib/uploadx.module';
export * from './lib/uploadx.provider';
export * from './lib/uploadx.service';
export * from './lib/utils';

0 comments on commit cf2f974

Please sign in to comment.