mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Remove route from login component and delegate the route to the parent
This commit is contained in:
@@ -1 +1 @@
|
||||
<alfresco-login></alfresco-login>
|
||||
<alfresco-login (onSuccess)="onLogin($event)" (onError)="onError($event)"></alfresco-login>
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AlfrescoLoginComponent } from 'ng2-alfresco-login';
|
||||
import { Router, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -24,9 +25,21 @@ declare let __moduleName: string;
|
||||
moduleId: __moduleName,
|
||||
selector: 'login-demo',
|
||||
templateUrl: './login-demo.component.html',
|
||||
directives: [AlfrescoLoginComponent],
|
||||
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent],
|
||||
pipes: []
|
||||
})
|
||||
export class LoginDemoComponent {
|
||||
|
||||
constructor(public router: Router) {
|
||||
}
|
||||
|
||||
onLogin($event) {
|
||||
console.log($event);
|
||||
this.router.navigate(['Home']);
|
||||
}
|
||||
|
||||
onError($event) {
|
||||
console.log($event);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user