@@ -3,12 +3,16 @@ import { Component } from '@angular/core';
3
3
import { HeaderComponent } from './components/header/view/Header.component' ;
4
4
import { LoginComponent } from './components/login/view/Login.component' ;
5
5
import { CrudComponent } from './components/crud/view/Crud.component'
6
+ import { KitchenComponent } from './components/kitchen/view/Kitchen.component'
6
7
7
8
import { User } from './models/user/User.model'
8
9
9
10
import { ROUTER_DIRECTIVES , Router , Routes } from "@angular/router" ;
10
11
11
12
@Routes ( [
13
+ { path : '' , component : CrudComponent } ,
14
+ { path : '/Tables' , component : CrudComponent } ,
15
+ { path : '/Kitchen' , component : KitchenComponent }
12
16
] )
13
17
14
18
@Component ( {
@@ -18,16 +22,22 @@ import {ROUTER_DIRECTIVES, Router, Routes} from "@angular/router";
18
22
styleUrls : [ 'oasp4js-sample.component.css' ] ,
19
23
directives : [ LoginComponent , HeaderComponent , CrudComponent , ROUTER_DIRECTIVES ]
20
24
} )
25
+
26
+
21
27
export class Oasp4jsSampleAppComponent {
22
28
title = "oasp4js-sample works!" ;
23
29
public login :boolean ;
24
30
public usuario : User = new User ( 0 , "" , "" ) ;
25
31
32
+ constructor ( private router : Router ) { }
33
+
26
34
enviar ( value ) {
27
35
setTimeout ( ( ) => { this . login = value ; } , 1 ) ;
36
+ this . router . navigate ( [ '/Tables' ] ) ;
28
37
}
29
38
30
39
logOut ( ) {
31
40
this . login = false ;
41
+ this . router . navigate ( [ '' ] ) ;
32
42
}
33
43
}
0 commit comments