Using let instead of var and relative template path

ref #17
This commit is contained in:
mauriziovitale84
2016-04-19 14:06:53 +01:00
parent 88bd8ea345
commit 4a0651f425
4 changed files with 7 additions and 4 deletions

View File

@@ -5,9 +5,10 @@ import {Authentication} from '../services/authentication';
@Component({
selector: 'login',
moduleId: 'app/components/login',
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
templateUrl: 'app/template/login.component.html',
styleUrls: ['app/style/login.component.css'],
templateUrl: 'login.component.html',
styleUrls: ['login.component.css'],
})
export class Login {
form:ControlGroup;
@@ -29,7 +30,9 @@ export class Login {
}
onSubmit(value:any, event) {
if (event) {
event.preventDefault();
}
this.auth.login('POST', value.username, value.password)
.subscribe(
(token:any) => this.router.navigate(['Home']),

View File

@@ -2,7 +2,7 @@ import {Injectable} from 'angular2/core';
import {Observable} from 'rxjs/Rx';
import {Http, Headers, URLSearchParams, Response} from 'angular2/http';
declare var xml2json:any;
declare let xml2json:any;
@Injectable()
export class Authentication {