mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#46 Add input text for authorization token
This commit is contained in:
@@ -24,7 +24,9 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
template: `<alfresco-upload-button [showDialogUpload]="true"
|
template: `<label for="token">Access Token</label><br>
|
||||||
|
<input id="token" type="text" size="48" (change)="updateToken()" [(ngModel)]="token"><br><br>
|
||||||
|
<alfresco-upload-button [showDialogUpload]="true"
|
||||||
[showUdoNotificationBar]="true"
|
[showUdoNotificationBar]="true"
|
||||||
[uploadFolders]="false"
|
[uploadFolders]="false"
|
||||||
[multipleFiles]="false"
|
[multipleFiles]="false"
|
||||||
@@ -59,8 +61,17 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/d
|
|||||||
directives: [ALFRESCO_ULPOAD_COMPONENTS]
|
directives: [ALFRESCO_ULPOAD_COMPONENTS]
|
||||||
})
|
})
|
||||||
export class MyDemoApp {
|
export class MyDemoApp {
|
||||||
|
token: string;
|
||||||
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
constructor(alfrescoSettingsService: AlfrescoSettingsService) {
|
||||||
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
||||||
|
|
||||||
|
if(localStorage.getItem('token')) {
|
||||||
|
this.token = localStorage.getItem('token');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateToken() {
|
||||||
|
localStorage.setItem('token', this.token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public customMethod(event: Object): void {
|
public customMethod(event: Object): void {
|
||||||
|
Reference in New Issue
Block a user