diff --git a/ng2-components/ng2-alfresco-upload/README.md b/ng2-components/ng2-alfresco-upload/README.md
index cf8538a4a6..6ba7121d26 100644
--- a/ng2-components/ng2-alfresco-upload/README.md
+++ b/ng2-components/ng2-alfresco-upload/README.md
@@ -1,4 +1,5 @@
# Alfresco Upload Component for Angular 2
+
+ (onSuccess)="onSuccess($event)">
- `,
- directives: [ALFRESCO_ULPOAD_COMPONENTS]
+ `
})
export class MyDemoApp {
- constructor(alfrescoSettingsService: AlfrescoSettingsService) {
- alfrescoSettingsService.host = 'http://myalfrescoip';
+
+ constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) {
+ settingsService.ecmHost = 'http://localhost:8080';
+
+ this.authService.login('admin', 'admin').subscribe(
+ ticket => {
+ console.log(ticket);
+ },
+ error => {
+ console.log(error);
+ });
}
- public customMethod(event: Object): void {
+ public onSuccess(event: Object): void {
console.log('File uploaded');
}
}
-bootstrap(MyDemoApp, [
- HTTP_PROVIDERS,
- ALFRESCO_CORE_PROVIDERS,
- UploadService
-]);
+@NgModule({
+ imports: [
+ BrowserModule,
+ CoreModule.forRoot(),
+ UploadModule.forRoot()
+ ],
+ declarations: [ MyDemoApp ],
+ bootstrap: [ MyDemoApp ]
+})
+export class AppModule { }
+
+platformBrowserDynamic().bootstrapModule(AppModule);
```
#### Events
@@ -169,40 +190,52 @@ This component, provide a drag and drop are to upload files to alfresco.
Example of an App that declares upload drag and drop component :
```ts
-import { Component, OnInit } from '@angular/core';
-import { bootstrap } from '@angular/platform-browser-dynamic';
-import { HTTP_PROVIDERS } from '@angular/http';
-import {
- ALFRESCO_CORE_PROVIDERS,
- AlfrescoSettingsService
-} from 'ng2-alfresco-core';
-import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload';
+import { NgModule, Component } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
+import { UploadModule } from 'ng2-alfresco-upload';
@Component({
- selector: 'my-app',
+ selector: 'alfresco-app-demo',
template: `
DRAG HERE
- `,
- directives: [ALFRESCO_ULPOAD_COMPONENTS]
+ `
})
export class MyDemoApp {
- constructor(alfrescoSettingsService: AlfrescoSettingsService) {
- alfrescoSettingsService.host = 'http://myalfrescoip';
+
+ constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) {
+ settingsService.ecmHost = 'http://localhost:8080';
+
+ this.authService.login('admin', 'admin').subscribe(
+ ticket => {
+ console.log(ticket);
+ },
+ error => {
+ console.log(error);
+ });
}
- public customMethod(event: Object): void {
+ public onSuccess(event: Object): void {
console.log('File uploaded');
}
}
-bootstrap(MyDemoApp, [
- HTTP_PROVIDERS,
- ALFRESCO_CORE_PROVIDERS,
- UploadService
-]);
+@NgModule({
+ imports: [
+ BrowserModule,
+ CoreModule.forRoot(),
+ UploadModule.forRoot()
+ ],
+ declarations: [ MyDemoApp ],
+ bootstrap: [ MyDemoApp ]
+})
+export class AppModule { }
+
+platformBrowserDynamic().bootstrapModule(AppModule);
```
@@ -232,6 +265,7 @@ with upload button or drag & drop area components. This component should
```
## Build from sources
+
Alternatively you can build component from sources with the following commands:
@@ -240,28 +274,28 @@ npm install
npm run build
```
-##Build the files and keep watching for changes
+### Build the files and keep watching for changes
```sh
-npm run build:w
+$ npm run build:w
```
-
+
## Running unit tests
```sh
npm test
```
-## Running unit tests in browser
+### Running unit tests in browser
```sh
npm test-browser
```
-This task rebuilds all the code, runs tslint, license checks and other quality check tools
-before performing unit testing.
+This task rebuilds all the code, runs tslint, license checks and other quality check tools
+before performing unit testing.
-## Code coverage
+### Code coverage
```sh
npm run coverage
@@ -276,3 +310,7 @@ cd demo
npm install
npm start
```
+
+## License
+
+[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE)
\ No newline at end of file
diff --git a/ng2-components/ng2-alfresco-upload/demo/package.json b/ng2-components/ng2-alfresco-upload/demo/package.json
index 4c4fcd6494..d45d34350d 100644
--- a/ng2-components/ng2-alfresco-upload/demo/package.json
+++ b/ng2-components/ng2-alfresco-upload/demo/package.json
@@ -45,28 +45,6 @@
"alfresco"
],
"dependencies": {
- "@angular/common": "2.0.0",
- "@angular/compiler": "2.0.0",
- "@angular/core": "2.0.0",
- "@angular/forms": "2.0.0",
- "@angular/http": "2.0.0",
- "@angular/platform-browser": "2.0.0",
- "@angular/platform-browser-dynamic": "2.0.0",
- "@angular/router": "3.0.0",
- "@angular/upgrade": "2.0.0"
- "@types/node": "^6.0.42", ,
- "core-js": "^2.4.1",
- "reflect-metadata": "^0.1.3",
- "rxjs": "5.0.0-beta.12",
- "systemjs": "0.19.27",
- "zone.js": "^0.6.23",
-
- "ng2-translate": "2.5.0",
- "material-design-icons": "2.2.3",
- "material-design-lite": "1.2.1",
-
- "alfresco-js-api": "^0.3.0",
- "ng2-alfresco-core": "^0.3.0",
"ng2-alfresco-upload": "^0.3.0"
},
"devDependencies": {
diff --git a/ng2-components/ng2-alfresco-upload/demo/src/main.ts b/ng2-components/ng2-alfresco-upload/demo/src/main.ts
index d03a393d23..51ea3cf502 100644
--- a/ng2-components/ng2-alfresco-upload/demo/src/main.ts
+++ b/ng2-components/ng2-alfresco-upload/demo/src/main.ts
@@ -69,7 +69,6 @@ import { UploadModule } from 'ng2-alfresco-upload';
-