diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8ad27ba..4bc3a4d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,8 +2,9 @@ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; const routes: Routes = [ + { path: '', redirectTo: 'loggin', pathMatch: 'full' }, { - path: '', + path: 'tabs', loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) }, { diff --git a/src/app/loggin/loggin.page.html b/src/app/loggin/loggin.page.html index eef2ea7..14720e9 100644 --- a/src/app/loggin/loggin.page.html +++ b/src/app/loggin/loggin.page.html @@ -5,5 +5,48 @@ + + + + +
+ + {{errorMessage}} + +
+ +
+
+ + + + + + + + + + + +
+
+
+ + Entrar + +
+
+
+
diff --git a/src/app/loggin/loggin.page.scss b/src/app/loggin/loggin.page.scss index e69de29..59a64b7 100644 --- a/src/app/loggin/loggin.page.scss +++ b/src/app/loggin/loggin.page.scss @@ -0,0 +1,12 @@ +ion-grid { + width:100%; + height: 100%; + + background-repeat: no-repeat; + background-size: cover; + background-position: center; + } + + ion-row { + height: 100%; + } \ No newline at end of file diff --git a/src/app/loggin/loggin.page.ts b/src/app/loggin/loggin.page.ts index 5f0e7db..ef1705f 100644 --- a/src/app/loggin/loggin.page.ts +++ b/src/app/loggin/loggin.page.ts @@ -1,4 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { NgForm } from '@angular/forms'; +import { Router } from '@angular/router'; +import { NavController } from '@ionic/angular'; @Component({ selector: 'app-loggin', @@ -6,10 +9,20 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./loggin.page.scss'], }) export class LogginPage implements OnInit { - - constructor() { } + @ViewChild(NgForm, {static: true}) ngForm: NgForm; + errorMessage = null; + data = {username: null, password: null}; + constructor(private router: Router, + private nav: NavController) { } ngOnInit() { } - + + login() { + if (this.ngForm.invalid) { + this.errorMessage = 'Complete el formulario'; + return; + } + this.nav.navigateRoot('/tabs') + } } diff --git a/src/app/tab1/tab1.page.html b/src/app/tab1/tab1.page.html index 22e11e4..2d463a8 100644 --- a/src/app/tab1/tab1.page.html +++ b/src/app/tab1/tab1.page.html @@ -1,7 +1,7 @@ - Tab 1 + Datos @@ -9,9 +9,9 @@ - Tab 1 + Datos - + diff --git a/src/app/tabs/tabs-routing.module.ts b/src/app/tabs/tabs-routing.module.ts index 468f849..b1e13f7 100644 --- a/src/app/tabs/tabs-routing.module.ts +++ b/src/app/tabs/tabs-routing.module.ts @@ -4,7 +4,7 @@ import { TabsPage } from './tabs.page'; const routes: Routes = [ { - path: 'tabs', + path: '', component: TabsPage, children: [ { diff --git a/src/app/tabs/tabs.page.html b/src/app/tabs/tabs.page.html index 0995c40..a491f37 100644 --- a/src/app/tabs/tabs.page.html +++ b/src/app/tabs/tabs.page.html @@ -2,18 +2,18 @@ - - Tab 1 + + Datos - - Tab 2 + + Sintomas - - Tab 3 + + Información