Remove route from login component and delegate the route to the parent

This commit is contained in:
mauriziovitale84
2016-06-16 12:20:55 +01:00
parent 4e47ce3327
commit 950cc4d076
4 changed files with 18 additions and 20 deletions

View File

@@ -1 +1 @@
<alfresco-login></alfresco-login>
<alfresco-login (onSuccess)="onLogin($event)" (onError)="onError($event)"></alfresco-login>

View File

@@ -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);
}
}