Skip to content

Commit

Permalink
docs: add gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Dec 23, 2016
1 parent 5871821 commit 0f40e97
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
**/*.js.map
**/*.d.ts

/docs

/aot
*.metadata.json
**/*.ngFactory.ts

/npm-debug.log

/node_modules
/typings
/typings

!gulpfile.js
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ For demos please see [demos page](http://ng2-uploader.com).
npm install ng2-uploader --save
```

### API Docs

[http://docs.ng2-uploader.com](http://docs.ng2-uploader.com)

### Available parameters

|Parameter | Example Value
Expand Down Expand Up @@ -54,6 +58,7 @@ import { Ng2UploaderModule } from 'ng2-uploader';
})
// app.component.ts
import { Component } from '@angular/core';
import { Ng2UploaderOptions } from 'ng2-uploader';

@Component({
selector: 'demo-app',
Expand All @@ -62,7 +67,7 @@ import { Component } from '@angular/core';
export class DemoApp {
uploadFile: any;
hasBaseDropZoneOver: boolean = false;
options: Object = {
options: Ng2UploaderOptions = {
url: 'http://localhost:10050/upload'
};
sizeLimit = 2000000;
Expand Down Expand Up @@ -118,14 +123,15 @@ This example show how to use available options and progress.

```ts
import { Component, OnInit, NgZone } from '@angular/core';
import { Ng2UploaderOptions } from 'ng2-uploader';

@Component({
selector: 'app-component',
templateUrl: 'app.component.html'
})
export class AppDemoComponent implements OnInit {
private zone: NgZone;
private options: Object;
private options: Ng2UploaderOptions;
private progress: number = 0;
private response: any = {};

Expand Down
25 changes: 25 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const gulp = require('gulp');
const typedoc = require('gulp-typedoc');

gulp.task('docs', () => {
return gulp.src([
'index.ts',
'!node_modules/**/*'])
.pipe(typedoc({
name: 'ng2-uploader docs',
mode: 'file',
out: 'docs',
ignoreCompilerErrors: true,
experimentalDecorators: true,
emitDecoratorMetadata: true,
target: 'ES5',
moduleResolution: 'node',
preserveConstEnums: true,
stripInternal: true,
suppressExcessPropertyErrors: true,
suppressImplicitAnyIndexErrors: true,
module: 'commonjs',
ignoreCompilerErrors: true,
noLib: true
}));
});
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"clean": "./scripts/clean.sh",
"dev": "tsc --watch",
"build": "./node_modules/.bin/ngc -p tsconfig.json",
"prepublish": "npm run build"
"prepublish": "npm run build",
"docs": "gulp docs"
},
"repository": {
"type": "git",
Expand All @@ -34,8 +35,11 @@
"@angular/platform-server": "^2.4.1",
"@types/core-js": "^0.9.35",
"@types/node": "^6.0.52",
"gulp": "^3.9.1",
"gulp-typedoc": "^2.0.1",
"reflect-metadata": "^0.1.9",
"rxjs": "5.0.1",
"typedoc": "^0.5.1",
"typescript": "2.0.10",
"zone.js": "^0.7.4"
}
Expand Down

0 comments on commit 0f40e97

Please sign in to comment.