Discussion for angular (2+) - need help? create a stackblitz with your issue to get help faster using this template: https://stackblitz.com/fork/angular-issue-repro2
renovate[bot] on angular
build: update angular to v12.0.5 (compare)
ngOnInit() {
this.selectorForm = this.myService.toFormGroup(
(this
.selectorFormField$ as unknown) as FormFieldBase<string>[]
);
this.selectorForm.valueChanges.subscribe((selection) => {
this.selectedType = selection[resourceTypeSelectorKey];
this.selectedItem = this.myService.getItem(
this.selectedType
);
this.configurationFormFields$ = this.myService.getConfigurationFormFields(
this.selectedType
);
this.configuratonForm = this.myService.toFormGroup(
(this
.configurationFormFields$ as unknown) as FormFieldBase<string>[]
);
});
}
After a value change in one input (not wrapped in form) a variable is set and the corresponding div section with ngIf renders a <form>
happens even when 2 different sibling forms with no common ancestor.
Is the issue when control groups are not wrapped in formGroupName by has its own formGroup
let-data and I would like another one which reaches in to data. So I would want something like let-two="data?.one?.two". Or is even better, being able to skip the let-data entirely and have let-two="context?.one?.two"?
@BertrandMarechal I mean like this
<ul><li *ngFor="let item of myArray; let i = index”>{{item}}</li></ul>
<ul>
<ng-container *ngFor="let item1 of myArray; let j= index””>
<li *ngif=“j==i”>{{item1}}</li></ng-container> </ul>
l have two ul I want to appear second li according to check if there index equal or not
for(let i=0;i<isodetail.length;i++){
document.getElementById('radio_child').innerHTML=`
<input type="radio" id=${isodetail[i].iso} name="radio" value=${isodetail[i].iso} ${onchange="radioCall(isodetail[i].iso)"}>
<label for=${isodetail[i].iso}> above ${isodetail[i].iso} %</label><br>
`
}
Please take note of following points that was already tried out:
Alfresco(exposed at localhost:8088) :Have configured filter for tomcat(in Alfresco) as in this post AngularJS / Alfresco / CORS filter issue: No 'Access-Control-Allow-Origin' header
Angular(exposed at localhost:4200) : Have setup application to work with proxy to access 8088 https://levelup.gitconnected.com/fixing-cors-errors-with-angular-cli-proxy-e5e0ef143f85
After trying both still get the CORS error as following: Access to XMLHttpRequest at 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Any suggestions ??
Hi,
I am using valueChanges to track a form control. This works just fine. But when I am passing the same FormGroup through router and setting the values, this event is not triggered.
ngOnInit(): void {
this.clientService.getAllClients().subscribe(data => {
this.clientDetails = data;
});
this.billingClientForm.get("clientName").valueChanges.subscribe(() => {
console.log(this.billingClientForm.get("clientName").value)
this.clientFormData.emit(this.billingClientForm);
})
}
constructor(private fb: FormBuilder, private clientService: ClientsService, private router: Router
) {
const value = this.router.getCurrentNavigation().extras.state?.client;
this.setBillingClientFromRoute(value);
}
onClick(result: Client) {
this.billingClientForm.get("clientName").setValue(result.clientName)
this.showDropdown = false;
this.showClientDetails = true;
console.log(this.billingClientForm)
this.setBillingClientForm(result);
}
setBillingClientForm(result: Client) {
this.billingClientForm.get('clientId').setValue(result.clientId);
this.billingClientForm.get('clientName').setValue(result.clientName);
this.billingClientForm.get('mobile').setValue(result.mobile);
this.billingClientForm.get('email').setValue(result.email);
this.billingClientForm.get('gstNumber').setValue(result.gstNumber);
// this.billingClientForm.get('isActive').setValue(result.isActive);
this.billingClientForm.get('address').get('storeName').setValue(result.address.storeName);
this.billingClientForm.get('address').get('address1').setValue(result.address.addressLine1);
this.billingClientForm.get('address').get('address2').setValue(result.address.addressLine2);
this.billingClientForm.get('address').get('city').setValue(result.address.city);
this.billingClientForm.get('address').get('state').setValue(result.address.state);
this.billingClientForm.get('address').get('zip').setValue(result.address.zip);
this.billingClientForm.get('address').get('country').setValue(result.address.country);
}Router Code :
this.router.navigate(['new-bill'], { state: { client: this.client } });Can anyone suggest what is the issue here?
Class constructor ButtonRenderer cannot be invoked without 'new'