Samuel Tucker

Samuel Tucker

1548245048

FormArray : Cannot find control with unspecified name attribute in angular6

I created a form using the reactive and presentation form. When I invoke the fields for the submission form, this gives me the error.

this Erorr :

Cannot find control with unspecified name attribute
    addProductFG:FormGroup;
  cats:Category[];
  subCats:Category[];
  PD:Productdetail[];
  selectedCat:number;
  valueIngrident=new FormArray([]);
  public loading=false;

constructor(private fb:FormBuilder,private productService:ProductinfoService,private catService:CategoryService) { }

ngOnInit() {
this.loading=true;
this.InitialFrom();
this.GetMainCat();
}

public CreateValueFiled(PD:Productdetail[]){
PD.map(element => {
this.valueIngrident.push(
new FormGroup({
infoId:new FormControl(element.id),
value:new FormControl(‘’)
})
)
});
}

public GetMainCat(){
this.catService.GetMainCat().subscribe(
res=>{
this.cats=res;
this.loading=false;
}
)
}

get ValueFormControl(){
return this.addProductFG.get(‘values’) as FormArray;
}

public InitialFrom():FormGroup{

this.addProductFG=this.fb.group({
  productTitle:['',Validators.compose([Validators.required])],
  productName:['',Validators.compose([Validators.required])],
  color:['',Validators.compose([Validators.required])],
  productImageName:['',Validators.compose([Validators.required])],
  price:['',Validators.compose([Validators.required])],
  gurantyMonth:['',Validators.compose([Validators.required])],
  gurantyCompanyName:['',Validators.compose([Validators.required])],
  values:this.valueIngrident
})
return this.addProductFG;

}
public ChangeSubCat(id:number){
this.loading=true;
this.catService.GetSubCatByCatId(id).subscribe(
res=>{
this.subCats=res;
this.loading=false;
}
)
}

public ChangeFormByType(id:number){
this.loading=true;
this.productService.GetPCIBySubId(id).subscribe(
res=>{
this.PD=res,
this.CreateValueFiled(this.PD),
this.loading=false;
}
)
}

and in HTML :

       <div formArray=“values”>
<div *ngFor=“let valueCtrl of ValueFormControl.controls; let i=index” [formGroupName]=“i”>
<div class=“form-inline lbin”>
<label>g </label>
<input formControlName=“value” >
</div>
</div>
</div>

and And this is my sample code in stackblitz Demo

Whats the Problem ? How Can I Solve This problem ?

#javascript #angular #typescript #forms

What is GEEK

Buddha Community

You should be using formArrayName instead of formArray:

<div formArrayName="values">

Forked Stackblitz

Also please keep your variables in sync:

ts

AddP: FormGroup; // why upper case?

html

[formGroup]="addP" 

Javascript is case-sensitive language

Samuel Tucker

Samuel Tucker

1548245048

FormArray : Cannot find control with unspecified name attribute in angular6

I created a form using the reactive and presentation form. When I invoke the fields for the submission form, this gives me the error.

this Erorr :

Cannot find control with unspecified name attribute
    addProductFG:FormGroup;
  cats:Category[];
  subCats:Category[];
  PD:Productdetail[];
  selectedCat:number;
  valueIngrident=new FormArray([]);
  public loading=false;

constructor(private fb:FormBuilder,private productService:ProductinfoService,private catService:CategoryService) { }

ngOnInit() {
this.loading=true;
this.InitialFrom();
this.GetMainCat();
}

public CreateValueFiled(PD:Productdetail[]){
PD.map(element => {
this.valueIngrident.push(
new FormGroup({
infoId:new FormControl(element.id),
value:new FormControl(‘’)
})
)
});
}

public GetMainCat(){
this.catService.GetMainCat().subscribe(
res=>{
this.cats=res;
this.loading=false;
}
)
}

get ValueFormControl(){
return this.addProductFG.get(‘values’) as FormArray;
}

public InitialFrom():FormGroup{

this.addProductFG=this.fb.group({
  productTitle:['',Validators.compose([Validators.required])],
  productName:['',Validators.compose([Validators.required])],
  color:['',Validators.compose([Validators.required])],
  productImageName:['',Validators.compose([Validators.required])],
  price:['',Validators.compose([Validators.required])],
  gurantyMonth:['',Validators.compose([Validators.required])],
  gurantyCompanyName:['',Validators.compose([Validators.required])],
  values:this.valueIngrident
})
return this.addProductFG;

}
public ChangeSubCat(id:number){
this.loading=true;
this.catService.GetSubCatByCatId(id).subscribe(
res=>{
this.subCats=res;
this.loading=false;
}
)
}

public ChangeFormByType(id:number){
this.loading=true;
this.productService.GetPCIBySubId(id).subscribe(
res=>{
this.PD=res,
this.CreateValueFiled(this.PD),
this.loading=false;
}
)
}

and in HTML :

       <div formArray=“values”>
<div *ngFor=“let valueCtrl of ValueFormControl.controls; let i=index” [formGroupName]=“i”>
<div class=“form-inline lbin”>
<label>g </label>
<input formControlName=“value” >
</div>
</div>
</div>

and And this is my sample code in stackblitz Demo

Whats the Problem ? How Can I Solve This problem ?

#javascript #angular #typescript #forms

Madelyn  Frami

Madelyn Frami

1598438700

10 Open Source/Commercial Control Panels For Virtual Machines (VM's) Management

Automatic creation and management of virtual machines is a topical issue for any company that provides VPS services. If you manage a large number of machines, a command line is definitely not the only tool you may need to perform various operations including client tasks, because such operations may be time-consuming.

In order to simplify routine tasks of server administrators and users, various companies develop control panels for virtual machines management, including interface-based solutions.

Don’t Miss20 Open Source/Commercial Control Panels to Manage Linux Servers

A control panel empowers you to perform any operation with a mouse click, whereas it would take you a good deal of time to complete the same task in the console. With a control panel, you will save your time and effort. However, it’s not all that simple.

Nowadays, VMmanager is the most popular software product for small and medium-sized businesses. VMware, in its turn, is a leading solution for large organizations. Both software products are commercial and rather expensive.

They deliver a large number of functions, however, some companies, especially, startups may need them. Besides, many of them cannot afford such an expensive product. For example, startups and companies in times of crisis may experience financial difficulties. Moreover, one can find interesting, outstanding solutions integrated with billing systems including tools for VM management.

How not to get lost among a great number of offers? We decided to help our users and wrote the following article, in which they will find answers to this question.

In this article, we will describe control panels for virtual machines management, both commercial and open-source, and help you choose the right solution to meet your personal needs.

1. VMmanager

VMmanager is one of the most popular commercial server virtualizations platforms based on QEMU/KVM technology. The solution has a reach feature set, that can suit both IT infrastructure owners and VPS services providers’ needs.

Virtual servers can be created within 2 minutes. Many routine tasks are performed automatically: including migration, cloning, reinstalling the OS, backups, adding and deleting interfaces, virtual server image creation, monitoring, statistics collection, server provisioning, etc.

The main advantages of VMmanager are:

  • Centralized management of various clusters.
  • Fault tolerance due to a microservice architecture.
  • Overselling, which helps to improve VPS provider’s equipment efficiency.
  • Complete control of the infrastructure thanks to a robust system of metrics collection.
  • A modern and intuitive interface.

VMmanager - Virtualization Management Platform

VMmanager – Virtualization Management Platform

2. VMware vSphere

VMware vSphere is the world’s leading server virtualization platform for building cloud infrastructure. With tons of its different powerful features, vSphere is a truely state-of-the-art software virtual machines management software. It is an ideal solution for large VPS providers with appropriate budgets and professional staff.

VMWare vSphere - Server Virtualization Platform

#control panels #virtualization #hosting control panel #linux control panels #virtual mahine control panels #linux

Joseph  Murray

Joseph Murray

1624006380

Understanding Control Structures in Java

As we know, a program consists of lists of instructions. Control structures are programming block that can change the path we take through those instructions or not. It is a syntactic form in a programming language to express flow of control.

In java and also in every other programming language there are three basic control structures:

  • Sequence Structure
  • Repetition Structure
  • Selection Structure

#programming #java #control #software-development #understanding control structures in java #control structures in java

Ray  Patel

Ray Patel

1623940860

Way to find out if DNS is down or your instance with python

DNS-PING

Way to find out if DNS is down or your instance.

Problem: At times it happens that DNS provider services of a website URL is down and so to reduce response time by not diagnosing the infrastructure and informing the user to check with DNS provider.

Functionality: Lambda in python pings the URL to be monitored and fetch the response. If the response code is anything other than 200 it triggers CloudWatch event and send SNS to user.

How to Run the Script : Create a Lambda function called “DNS-PING” the run-time version Python 3.6 and above by using the attach code. Creation of the Lambda function will in turn create CloudWatch Logs groups for its logging. Lamda can be call every 5 mins or as per your business requirement.

#network #way to find out if dns is down or your instance with python #python #dns #way to find out if dns is down or your instance #find out if dns

Lisa joly

Lisa joly

1624550520

Do this If You Want to Find Hidden Gems in 2021! (Secret Formula to Quickly Find Gems)

In this video i talk about the elements of formula you should look for and pre screen projects for. Is they don’t have 3 of these elements it’s likely it won’t be success in the long term at least.

📺 The video in this post was made by Crypto expat
The origin of the article: https://www.youtube.com/watch?v=1zqvCqCWrF8
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!

#bitcoin #blockchain #hidden gems #find gems #do this if you want to find hidden gems in 2021! (secret formula to quickly find gems) #2021