Angular From Scratch Tutorial – Index
PREVIOUS: Angular From Scratch Tutorial – Step 7
NEXT: Angular From Scratch Tutorial – Step 9: Modal
Table of Contents
TARGET
Several additional stuff.
ngStyle
SEE:
– NgStyle & NgClass
ngClass
SEE:
– NgStyle & NgClass
– Angular NgClass Example – How to Add Conditional CSS Classes
Return value
email(): string | null {
return localStorage.getItem('email');
}
Form Validation
<form action="/api/todo/createbytitle" method="post" id="modal_create_todo_form"
#f="ngForm" (ngSubmit)="f.form.valid && newTodoSubmit()" novalidate>
<div *ngIf="!f.the_title && f.submitted" class="text-danger">
A task is required
</div>
<input name="the_title" id="the_title_id" [(ngModel)]="form.theTitle"
@NOTE:
novalidate attribute is used to disable browser’s native form validation.
Angular From Scratch Tutorial – Index
PREVIOUS: Angular From Scratch Tutorial – Step 7
NEXT: Angular From Scratch Tutorial – Step 9: Modal
Brazilian system analyst graduated by UNESA (University Estácio de Sá – Rio de Janeiro). Geek by heart.