Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Haaris M
@ischyron
container component with 2 forms
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>[]
            );
        });
    }
Haaris M
@ischyron

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

mohammadzbggo
@mohammadzbggo
Hi, quick question for angular application routing, how do I set parameterized queries for the url? Any reference material I can read? I have an SPA app.
1 reply
Jim Lynch
@JimLynchCodes
can, can anyone pls halp. ngrx seems to be not working right for me. I posted a question in the ngrx/store channel. thanks!
Saudamini
@Saudamini_gitlab
Hi there.Can anyone share some reference link for angular PWA
thomas-bee
@thomas-bee
We have an angular app with ngrx/store running against a significant REST API backend. We have started building also some GraphlQL APIs hence we will have a mixture. Would you recommend moving away from ngrx/store and move to apollo-client? Is using appollo against a REST backend a good idea?
BertrandMarechal
@BertrandMarechal
@mohammadzbggo what do you mean by expect(responder.locals.context.recordingId).to.equal("recordingId"); ?
sanket-thotange
@sanket-thotange

@sanket-thotange just CTRL+C then restart ng serve

I tried the same. I think its the issue with incorrect angular upgrade that I did.

Is is necessary to use OnDestroy hook in app.component to unsubscribe from subscriptions?
clintsinger
@clintsinger
Is there a way to use "let-" syntax with complex objects? Say I have the default context going into 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"?
Doaa Othman
@DoaaOthman
Please I want to pass index of element in ngfor to other how can I do that
BertrandMarechal
@BertrandMarechal
@DoaaOthman *ngFor="let item of myArray; let i = index" <= i will contain your index
Saudamini
@Saudamini_gitlab
Hi there.Anyone one here worked on index db to store data offline and sync the data once the application is online
Doaa Othman
@DoaaOthman

@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

BertrandMarechal
@BertrandMarechal
not sure you can if the element you want to pass it to is not a child of the one having the index as i
you may have to rework your logic
ishu mishra
@coderishu
Hi All
 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>
    `
  }
i am trying to create 3 radio buttons with labels and attaching onchange method
i think i am doing something wrong
as its showing only last value from array
BertrandMarechal
@BertrandMarechal
Well your code overwrites the innerHtml with the value you pass every time, so it will always put the value from the latest element in the array
why not using ngFor ?
justinmgeorge
@justinmgeorge
How to setup Cors policy in angular/alfresco while calling alfresco share Rest Api in angular don't end?

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 ??

Miloš Lapiš
@mlc-mlapis
@justinmgeorge Simply config your server-side that it adds the following headers to each response:
header('Access-Control-Allow-Origin: *'); 
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, OPTIONS');
Amit Sahoo
@Amiit006
Hi, I have a table which has invoice details ->
It can spread over multiple pages while printing. I am using ngxPrint for printing.
My requirement is when multiple page will be there then all page should have subtotal. How can I achieve this? Please help
Vikas Dulgunde
@vikasdc
hi all, i want to send a telegram message using my own account with javascript code! can anyone help me please?
Goutam Kumar Dhandh
@GoutamZiroh
you should use telegram API link :https://core.telegram.org/
They Use WASM instead of Rest call @vikasdc
vigouredelaruse
@vigouredelaruse
howdee. i'm the fool use case who doesn't understand how to deploy angular build output for a component only. the use case is i want to write not a full angular app with routing, and services in the root, but entirely self contained modules i can distribute from package management and consumers can just deploy the javascript file and get fancy PART OF THE ui generated by angular.
please advise
vigouredelaruse
@vigouredelaruse
when writing distributable modules i suppose i want to confirm whether or not the development environment MUST be initialized with the equivalent of ng new ng-dev-environment-for-building-components
artart37
@artart37
Hi everyone, I am thinking about the best way to smoothly scroll in to a position. Th scrollintoview method is nice, but its not completely cross-browser compatible and angular's viewportScroller doesn't appear to have the ability of smoth scrolling or any sort of animation. Any ideas where to start from?
moustacheman1
@moustacheman1
Anyone know how to create something like google docs' comments and suggestions using angular material? I've got the basic format of the mat-card down just not sure how to handle how to do the layout of each card
Saudamini
@Saudamini_gitlab
Anyone knows how to integrate angular pwa in asp.net mvc
Saudamini
@Saudamini_gitlab
service-worker.js:702 Service worker registration failed with: TypeError: Failed to register a ServiceWorker for scope ('http://localhost/') with script ('http://localhost/ngsw-worker.js'): A bad HTTP response code (404) was received when fetching the script.
I am getting error.Can anyone knows how to resolve it
thomas-bee
@thomas-bee
Is there an agreed upon way how to best do server-to-client notifications (Springboot to Angular) these days?
Luiggi
@luiggidesigner_twitter
hey people, Is it possible to get the value of var inside component(in angular not in test) from protractor in e2e? Like count:number =2; I need to know in test what's the value in this var, is it possible?
neerajkbharti
@neerajkbharti
Hellow everyone
need one help on unit test
onChange(indexes: number[]): void {
Iif (indexes[0]) {
this.sliderLeftArrow = false;
this.sliderRightArrow = true;
} else {
this.sliderLeftArrow = true;
this.sliderRightArrow = false;
}
}
how to cover if statement in jasmine
yash2701
@yash2701
Does any one have issue after move to angular 12
from Css Minimizer
Error: Unexpected '/'. Escaping special characters with \ may help.
it showing 500 error in css files
yoan-asdrubal
@yoan-asdrubal
HI everyone, How can I generate angular documentation after apply any markup described in https://angular.io/guide/docs-style-guide page??? Y understand how to use <code-tabs> and <code-pane> for example, but i can't find how to generate doc after that.
Amit Sahoo
@Amiit006

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?

Renee Thomsen
@ReneeT19
Wrong link earlier. Below is the edit link.
My question is: how to display the buttons that trigger pop-up message within an ag-grid cell? The error message I have now says Class constructor ButtonRenderer cannot be invoked without 'new'
https://stackblitz.com/edit/angular-issue-repro2-k9ouxu?file=src/app/button-renderer.component.ts
Luke Crooks
@crooksey
Hi, I am trying to fix a third party library, I have forked the code and have updated it locally on my machine, how do I then get angular to install this local version of my changes, build the library to update my packages node_modules with the newly updated code so I can test it?