diff --git a/app/application.ts b/app/application.ts
index 1513266..31480fa 100644
--- a/app/application.ts
+++ b/app/application.ts
@@ -4,7 +4,7 @@ import {UserService} from './services/user.service';
import {KlassService} from './services/klass.service';
import {FooterComponent} from './components/footer.component';
import {ContentComponent} from './components/content.component';
-import {HomeComponent} from './components/home.component';
+import {KlassesComponent} from './components/klasses.component';
import {KlassComponent} from './components/klass.component';
@Component({
diff --git a/app/components/content.component.ts b/app/components/content.component.ts
index c4a7972..2bcf78c 100644
--- a/app/components/content.component.ts
+++ b/app/components/content.component.ts
@@ -1,7 +1,7 @@
import {Component} from 'angular2/core';
import {HeaderComponent} from './header.component';
-import {LoginFormComponent} from './login-form.component';
-import {HomeComponent} from './home.component';
+import {LoginComponent} from './login.component';
+import {KlassesComponent} from './klasses.component';
import {KlassComponent} from './klass.component';
import {UserService} from '../services/user.service';
import {User} from '../models/user';
@@ -14,21 +14,33 @@ import {Klass} from '../models/Klass';
`,
- directives:[HeaderComponent, LoginFormComponent, HomeComponent, KlassComponent]
+ directives:[HeaderComponent, LoginComponent, KlassesComponent, KlassComponent]
})
export class ContentComponent{
currentUser: User;
currentClass: Klass;
+ getTargetPage(){
+ if(!this.currentUser){
+ return 'login';
+ } else {
+ if(!this.currentClass){
+ return 'klasses'
+ }else{
+ return 'klass'
+ }
+ }
+ }
+
whenLoggedIn(user){
this.currentUser = user;
}
diff --git a/app/components/home.component.ts b/app/components/klasses.component.ts
similarity index 92%
rename from app/components/home.component.ts
rename to app/components/klasses.component.ts
index 0f6598f..9ae6178 100644
--- a/app/components/home.component.ts
+++ b/app/components/klasses.component.ts
@@ -3,7 +3,7 @@ import {KlassService} from '../services/klass.service';
import {Klass} from '../models/klass';
@Component({
- selector: 'home',
+ selector: 'klasses',
template: `
![]()
@@ -14,7 +14,7 @@ import {Klass} from '../models/klass';
`
})
-export class HomeComponent{
+export class KlassesComponent{
@Output() classSelected = new EventEmitter();
constructor(private klassService: KlassService) {}
diff --git a/app/components/login-form.component.ts b/app/components/login.component.ts
similarity index 72%
rename from app/components/login-form.component.ts
rename to app/components/login.component.ts
index 20325ec..d81fa60 100644
--- a/app/components/login-form.component.ts
+++ b/app/components/login.component.ts
@@ -2,10 +2,10 @@ import {Component, Output, EventEmitter} from 'angular2/core';
import {UserService} from '../services/user.service';
@Component({
- selector: 'login-form',
- templateUrl: 'app/templates/login-form.component.html'
+ selector: 'login',
+ templateUrl: 'app/templates/login.component.html'
})
-export class LoginFormComponent{
+export class LoginComponent{
@Output() loggedIn = new EventEmitter();
constructor(private _userService: UserService) {}
diff --git a/app/templates/login-form.component.html b/app/templates/login.component.html
similarity index 100%
rename from app/templates/login-form.component.html
rename to app/templates/login.component.html