mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
add config ip to login demo
This commit is contained in:
@@ -30,26 +30,38 @@ import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService, AlfrescoTranslatio
|
|||||||
])
|
])
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
template: '<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
template: `<label for="token"><b>Insert the ip of your Alfresco instance:</b></label><br>
|
||||||
|
<input id="token" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
|
||||||
|
{{ status }}
|
||||||
|
<hr>
|
||||||
|
<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>`,
|
||||||
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
|
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
|
|
||||||
constructor(public auth: AlfrescoAuthenticationService,
|
public host: string = 'http://192.168.99.100:8080';
|
||||||
public router: Router,
|
|
||||||
alfrescoSettingsService: AlfrescoSettingsService) {
|
|
||||||
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
|
||||||
|
|
||||||
|
public token: string;
|
||||||
|
|
||||||
|
public status: string = '';
|
||||||
|
|
||||||
|
constructor(public auth: AlfrescoAuthenticationService, public router: Router, private alfrescoSettingsService: AlfrescoSettingsService) {
|
||||||
|
alfrescoSettingsService.host = this.host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public updateHost(): void {
|
||||||
|
this.alfrescoSettingsService.host = this.host;
|
||||||
}
|
}
|
||||||
|
|
||||||
mySuccessMethod($event) {
|
mySuccessMethod($event) {
|
||||||
console.log('Success Login EventEmitt called with: ' + $event.value);
|
console.log('Success Login EventEmitt called with: ' + $event.value);
|
||||||
|
this.status = $event.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
myErrorMethod($event) {
|
myErrorMethod($event) {
|
||||||
console.log('Error Login EventEmitt called with: ' + $event.value);
|
console.log('Error Login EventEmitt called with: ' + $event.value);
|
||||||
|
this.status = $event.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
|
@@ -74,7 +74,7 @@ export class MyDemoApp implements OnInit {
|
|||||||
|
|
||||||
authenticated: boolean;
|
authenticated: boolean;
|
||||||
|
|
||||||
host: string = 'http://192.168.99.101:8080';
|
host: string = 'http://192.168.99.100:8080';
|
||||||
|
|
||||||
token: string;
|
token: string;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user