NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import { Component, OnInit, Input } from '@angular/core';

import { FormGroup, FormBuilder, Validators } from '@angular/forms';

import { DatePipe } from '@angular/common';

import { Router } from '@angular/router';

import { Patient } from '../../models/patient';

import { DataService } from '../../services/data.service';



@Component({

selector: 'app-form',

templateUrl: './form.component.html',

styleUrls: ['./form.component.css'],

providers: [DatePipe]

})

export class FormComponent implements OnInit {



complexForm: FormGroup;

patientDetails = new Patient;

today: string;

result;



noRecordsFound = 'No patient records found in the list. Click on Register New Patient to add Patient details.';



emptyFirstname = 'You must include a first name.';

minlengthFirstname = 'Your first name must be at least 3 characters long.';

maxlengthFirstname = 'Your first name cannot exceed 20 characters.';

emptyLastname = 'You must include a last name.';

minlengthLastname = 'Your last name must be at least 3 characters long.';

maxlengthLastname = 'Your last name cannot exceed 20 characters.';

noGender = 'You must select a gender.';

noDob = 'You must select a valid date of birth.';

noMobile = 'You must include mobile number.';

numberMobile = 'You must enter a valid 10 digit mobile number.';

maxlengthMobile = 'Your mobile number should not exceed 10 digits.';

noEmail = 'You must include a valid email.';

patternEmail = 'Pattern does not match.';



ngOnInit() {

this.today = this.datePipe.transform(Date.now(), 'yyyy-MM-dd');

}



constructor(fb: FormBuilder, private datePipe: DatePipe, private route: Router, private dataService: DataService) {



// add necessary validators



this.complexForm = fb.group({

firstName: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(20)]],

lastName: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(20)]],

gender: [null, Validators.required],

dob: [null, Validators.required],

mobile: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(10), Validators.pattern(/^d{10,}$/)]],

email: ['', [Validators.required, Validators.email, Validators.pattern(/^[w-.]+@([w-]+.)+[w-]{2,4}$/)]],

description: ''

});

}



submitForm(value: any) {



// assign new date object to reportedTime

// should reister new patient using service

// if added successfully should redirect to 'patientList' page



}



}

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.