Config and login
Change-Id: I81ffb9b8097620cb7870beaf1b1b315945eebec0
diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts
new file mode 100644
index 0000000..413290c
--- /dev/null
+++ b/src/app/components/login/login.component.ts
@@ -0,0 +1,38 @@
+/// <reference path="../../../../typings/index.d.ts"/>
+import {Component} from '@angular/core';
+import {Router} from '@angular/router';
+import {IAuthRequest, IAuthResponse} from '../../interfaces/auth.interface';
+import {StyleConfig} from '../../config/style.config';
+import {AuthService} from '../../services/rest/auth.service';
+
+export class Auth {
+ constructor(
+ public username,
+ public password
+ ){
+ }
+}
+
+@Component({
+ selector: 'xos-login',
+ template: require('./login.html'),
+ providers: [AuthService],
+})
+export class LoginComponent {
+ public auth:IAuthRequest;
+ public brandName;
+ constructor(private AuthService: AuthService, private router:Router) {
+ this.auth = new Auth('', '');
+ this.brandName = StyleConfig.projectName;
+ }
+
+ onSubmit(auth:IAuthRequest){
+ this.AuthService.login(auth)
+ .subscribe(
+ (user:IAuthResponse) => {
+ this.router.navigate(['/']);
+ }
+ )
+ }
+}
+