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

@@ -16,7 +16,6 @@
*/
import { Component, Output, EventEmitter } from '@angular/core';
import { Router, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from '@angular/common';
import {
AlfrescoTranslationService,
@@ -30,7 +29,7 @@ declare let __moduleName: string;
@Component({
selector: 'alfresco-login',
moduleId: __moduleName,
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
directives: [FORM_DIRECTIVES],
templateUrl: './alfresco-login.component.html',
styleUrls: ['./alfresco-login.component.css'],
pipes: [AlfrescoPipeTranslate]
@@ -60,12 +59,10 @@ export class AlfrescoLoginComponent {
* Constructor
* @param _fb
* @param auth
* @param router
* @param translate
*/
constructor(private _fb: FormBuilder,
public auth: AlfrescoAuthenticationService,
public router: Router,
private translate: AlfrescoTranslationService) {
this.formError = {
@@ -113,7 +110,6 @@ export class AlfrescoLoginComponent {
this.onSuccess.emit({
value: 'Login OK'
});
this.router.navigate(['Home']);
} catch (error) {
console.error(error.message);
}