mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -5,9 +5,10 @@ import {Authentication} from '../services/authentication';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'login',
|
selector: 'login',
|
||||||
|
moduleId: 'app/components/login',
|
||||||
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
|
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
|
||||||
templateUrl: 'app/template/login.component.html',
|
templateUrl: 'login.component.html',
|
||||||
styleUrls: ['app/style/login.component.css'],
|
styleUrls: ['login.component.css'],
|
||||||
})
|
})
|
||||||
export class Login {
|
export class Login {
|
||||||
form:ControlGroup;
|
form:ControlGroup;
|
||||||
@@ -29,7 +30,9 @@ export class Login {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(value:any, event) {
|
onSubmit(value:any, event) {
|
||||||
event.preventDefault();
|
if (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
this.auth.login('POST', value.username, value.password)
|
this.auth.login('POST', value.username, value.password)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(token:any) => this.router.navigate(['Home']),
|
(token:any) => this.router.navigate(['Home']),
|
||||||
|
@@ -2,7 +2,7 @@ import {Injectable} from 'angular2/core';
|
|||||||
import {Observable} from 'rxjs/Rx';
|
import {Observable} from 'rxjs/Rx';
|
||||||
import {Http, Headers, URLSearchParams, Response} from 'angular2/http';
|
import {Http, Headers, URLSearchParams, Response} from 'angular2/http';
|
||||||
|
|
||||||
declare var xml2json:any;
|
declare let xml2json:any;
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Authentication {
|
export class Authentication {
|
||||||
|
Reference in New Issue
Block a user