Categories
Mastering Development

How to make the entire values to be selected when shift+tab is used after tab out in angular8

i have an input field as amount, in which currency formatting has been done. Here i enter some values and come out using tab. Now i use shift+tab and go to the same field, so in this case i want the cursor is in the last digit i mean first number from right. Instead i […]

Categories
Mastering Development

how to integrate validity of nested form in the main form

I have component A which has a form. A has a child component B which also has a form. I want to add validation that the form in A gets submitted only if both A‘s form and B‘s form are valid. How can I do this? B‘s form has one field in it. createForm() { […]

Categories
Mastering Development

Error when I hit node js api through angular 8: Error: ER_BAD_NULL_ERROR: Column ‘name’ cannot be nul

I am very new to node and angular, I am trying to insert data into mysql I have node api when I test this api through postman record get inserted successfully, but when I call node api through angular I am getting error. angular CLI: 7.3.1 Node: 10.15.0 nodejs const express = require(‘express’); const bodyParser […]

Categories
Development

object value coming undefined in node controller function

I’ve created a contact form with angular 7 and integrated it with nodemailer so that upon submitting the form the details of the form should be submitted to an specified email. The view is working fine and passing the values perfectly, but when the values are sent to the node backend it’s coming as undefined […]

Categories
Development

how do i reset my data for my div class=”col-md-3″

So am using a database to store data. and when i enter the data the [div class=”col-md-3] <div class=”col-md-3″ style=”float: right; width: 500px”> <h2>Content from Firebase</h2> <pre *ngFor= “let item of items | async”></pre> </div> stores the data but it doesn’t reset when i relaunch the HTML. is there a way to reset this. am […]

Categories
Development

Angular Reactive Form Edit Mode, How to RePopulate Input type=file?

How can I repopulate my file with input type=file within a reactive form? I am working on a project where I have a form to submit data (workouts) which builds out a list according to the form. From there, you can go in to view the workout submitted, and edit it. When you click “Edit […]

Categories
Development

How do you pass FormGroups and FormArrays into a recursive mechanism of deep nested components?

I’m building a micro app for editing JSON objects before saving them to my database. The JSON object comes from another micro app I made for parsing SVG code and creating a data object shaped like the interfaces bellow. export interface OvaadSvgStyleProperty{ property: string; setting: string; } export interface OvaadGraphicAttribute{ attribute: string; setting: string; bind? […]

Categories
Development

Angular 8 FormGroup async validation from API call

I need to validate Unique product title, except the current product id. Please note that I need to validate FormGroup using async validation – API service call. The function contains hardcoded value 2, please ignore it. product-component.ts ngOnInit() { this.productForm = this.fb.group({ categoryId: [”, [Validators.required]], title: [”, [Validators.required]], description: [”], oldPrice: [”, [Validators.required, Validators.maxLength(10), Validators.pattern(‘^\\d+$’)]], […]

Categories
Development

Angular Material (8) Error Message (from Validator) being displayed when Page reloaded

I am new to Angular Material. I am working on a Registration form using Angular Material (8). When doing so, I am seeing that the Error Message is displayed when the page is Reloaded (by hitting the “Refresh” Button on the browser). The field is never touched in any way, shape or form. Why is […]

Categories
Development

Pushing FormControls dynamically to FormArray

I have a form spread across 3 subcomponents. There are 3 form groups. In the 3rd group is a FormArray. This form will hold FormControls that are simply true/false. One for each result returned from an API call. This worked just fine when this form was its own separate thing completely from the main form. […]