mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
test file preview demo
This commit is contained in:
parent
c42d497618
commit
1b9725ce32
@ -16,13 +16,51 @@ npm set registry http://devproducts.alfresco.me:4873
|
|||||||
npm install ng2-alfresco-viewer --save
|
npm install ng2-alfresco-viewer --save
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
#### Basic usage
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ng2-alfresco-viewer></ng2-alfresco-viewer>
|
<ng2-alfresco-viewer [urlFile]="'filename.pdf'"></ng2-alfresco-viewer>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Reference
|
#### Dependencies
|
||||||
|
|
||||||
|
Add the following dependency to your index.html:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="node_modules/pdfjs-dist/build/pdf.js"></script>
|
||||||
|
<script src="node_modules/pdfjs-dist/build/pdf.worker.js"></script>
|
||||||
|
<script src="node_modules/pdfjs-dist/web/pdf_viewer.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure your systemjs.config has the following configuration:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
System.config({
|
||||||
|
defaultJSExtensions: true,
|
||||||
|
map: {
|
||||||
|
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer',
|
||||||
|
'rxjs': 'node_modules/rxjs',
|
||||||
|
'angular2': 'node_modules/angular2',
|
||||||
|
'app': 'dist/main'
|
||||||
|
},
|
||||||
|
packages: {
|
||||||
|
'src': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'ng2-alfresco-viewer': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'rxjs': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'angular2': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Options
|
||||||
|
|
||||||
Attribute | Options | Default | Description
|
Attribute | Options | Default | Description
|
||||||
--- | --- | --- | ---
|
--- | --- | --- | ---
|
||||||
@ -33,37 +71,37 @@ Method | Parameters | Returns | Description
|
|||||||
--- | --- | --- | ---
|
--- | --- | --- | ---
|
||||||
`methodName()` | None. | void | Lorem ipsum dolor.
|
`methodName()` | None. | void | Lorem ipsum dolor.
|
||||||
|
|
||||||
## Develop command list
|
## Running unit tests
|
||||||
|
|
||||||
* To test your project
|
```sh
|
||||||
|
npm test
|
||||||
|
```
|
||||||
|
|
||||||
```sh
|
## Running unit tests in browser
|
||||||
$ npm run test
|
|
||||||
```
|
|
||||||
|
|
||||||
* To run the test in the browser
|
```sh
|
||||||
|
npm test-browser
|
||||||
|
```
|
||||||
|
|
||||||
```sh
|
This task rebuilds all the code, runs tslint, license checks and other quality check tools
|
||||||
$ npm run test-browser
|
before performing unit testing.
|
||||||
```
|
|
||||||
|
|
||||||
* To run the test coverage
|
## Code coverage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm run coverage
|
npm run coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
* To build the distribution files before releasing a new version.
|
## Demo
|
||||||
|
|
||||||
```sh
|
If you want have a demo of how the component works, please check the demo folder :
|
||||||
$ npm run start
|
|
||||||
```
|
|
||||||
|
|
||||||
* To provide a live demo
|
```sh
|
||||||
|
cd demo
|
||||||
|
npm install
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
|
||||||
```sh
|
|
||||||
$ npm run deploy
|
|
||||||
```
|
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user