Category : nested

Given the following TypeScript functions: public retrieveAllMembersIdsFromGroup(groupId: string): Observable<string[]> public retrieveMember(memberId: string): Observable<Member> How to combine this in one function to get all members (Observable)? public retieveAllMembersFromGroup(groupId: string): Observable<Member[]> For example I want to have something like this: public retieveAllMembersFromGroup(groupId: string): Observable<Member[]> { return this.retrieveAllMembersIdsFromGroup(groupId).pipe( map((membersIds: string[]) => { //some magic here to call this.retrieveMember(memberId) ..

Read more

I have a component which have HTML inside looking like this: <div class="wrapper"> <lqs-myComponent class="my-component" [ngClass]="myComponentStatus ? ‘is-active’ : ”"></lqs-myComponent> </div> The CSS (or some of it) for this component is: .wrapper { .my-component { display: grid; width: 100%; justify-self: center; box-sizing: border-box; border-radius: 5px; row-gap: 5px; align-self: start; &.is-active { > div { transition: ..

Read more

I have got problem when I want to input data of nested class in html form, Example JSON { "id": 6, "firstName": "Joanna", "lastName": "Walec", "salary": 5000.0, "department": "Analytics", "vacation": false, "enabled": true, "address": { "id": 6, "zipCode": 57532, "street": "Angular", "number": 2, "city": "New York", "country": "USA" } } Ids are auto incremented relation ..

Read more

What is a better alternative to simplify my nested code below? The code does work, but I do know that nested subscriptions aren’t good what I’ve read. I am also not sure if I should use mergeMap() or switchMap() in this particular example. private subscriptions: Subscription = new Subscription(); ngOnInit() { this.subscriptions.add(this._route.paramMap.subscribe((paramMap: ParamMap) => { ..

Read more

I have a Component, the selector is: app-common-component. The app-common-component based on an ngModelGroup : <fieldset ngModelGroup> </fieldset> I have a form, which separated to two components app-component-a and app-component-b <form> <app-component-a></app-component-a> <app-component-b></app-component-b> </form> The app-component-a contains the app-common-component <fieldset ngModelGroup="componenta"> <app-common-component></app-common-component> </fieldset> The app-component-b contains the app-common-component also <fieldset ngModelGroup="componentb"> <app-common-component></app-common-component> </fieldset> My question ..

Read more

i need some advice about angular-datatables, implemented to Angular 9. I have JSON return nested object array. Below is example data { "data" : "DocumentVM" : [ {ID:1, Name:"Document One"}, {ID:2, Name:"Document Two"}, {ID:3, Name:"Document Three"} ], "draw" : 1, "recordsFiltered" : 3, "recordsTotal" : 3 } This is my dashboard.component.ts and i use ngx-soap ..

Read more