Skip to content
Permalink
Browse files

Crear formulario de login en Ionic 4

  • Loading branch information
luiscordero29 committed Nov 11, 2018
1 parent 0976b78 commit 92ba90e0c9672ef289b05f1700cf79d17228b4fe
@@ -2,8 +2,9 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'login', loadChildren: './login/login.module#LoginPageModule' },
];

@NgModule({
@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { LoginPage } from './login.page';

const routes: Routes = [
{
path: '',
component: LoginPage
}
];

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [LoginPage]
})
export class LoginPageModule {}
@@ -0,0 +1,18 @@
<ion-header>
<ion-toolbar>
<ion-title>Iniciar Sesión</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item>
<ion-label position="stacked">Dirección de correo</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Constraseña</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-list>
<ion-button color="light" expand="full">Entrar</ion-button>
</ion-content>
No changes.
@@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LoginPage } from './login.page';

describe('LoginPage', () => {
let component: LoginPage;
let fixture: ComponentFixture<LoginPage>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(LoginPage);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {

constructor() { }

ngOnInit() {
}

}

0 comments on commit 92ba90e

Please sign in to comment.
You can’t perform that action at this time.