Angular Dropdown Excel Post

Issue I want to create a selection dropdown that when the user select a value it will send to the backend controller. This is my code so far anyone could help HTML <mat-form-field appearance="fill" class="dropDown1"> <mat-select [(ngModel)]="selectedTemplate"> <mat-option *ngFor="let items

Continue reading

[Object][Object] angular

Issue I’m trying to display the value in my form why i get [Object][Object] in my display i tried the ngModel but i have a validators this is the out TS ngOnInit(): void { this.Form = this.fb.group({ Code: ({value:this.idObj,}, Validators.required),

Continue reading

Rxjs subscribe deprication

Issue After going through a tutorial, I noticed the ‘subscribe’ was being deprecated. I tried following https://rxjs.dev/deprecations/subscribe-arguments and some stackoverflow questions like Typescript Deprecation warning but was not able to update to the new approach. I’ve include the code in

Continue reading

valueChanges event observable not caught in RXJS in angular

Issue In constructor I have: this.step1FormGroup = this.formBuilder.group({ firstLastName: new FormControl(”) }); this.step1FormGroup.get(‘firstLastName’).valueChanges.pipe( map((a) => { console.log(‘oy!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!’); return a; }) ); and in template I have this: <form [formGroup]="step1FormGroup"> <ng-template matStepLabel>Fill out your name</ng-template> <mat-form-field> <input matInput placeholder=’Last name, First

Continue reading

Angular test 'subscribe is not a function'

Issue In my component inside ngOnInit I have a subscribe() inside which I call a component function: ngOnInit(): void { this.navigationService.itemReset$.subscribe(event => this.resetItem(event)); } in the navigationService I have: btnPressed$: Subject<Event> = new Subject(); itemReset$: Observable<Event> = this.btnPressed$.asObservable(); keyDown(event: Event):

Continue reading

RxJS5 TypeScript typings fail

Issue I run tsc on my project, and I get these errors relating to the RxJS5 lib: $ tsc node_modules/rxjs/observable/FromEventObservable.d.ts(11,39): error TS2304: Cannot find name ‘EventTarget’. node_modules/rxjs/observable/FromEventObservable.d.ts(11,103): error TS2304: Cannot find name ‘NodeList’. node_modules/rxjs/observable/FromEventObservable.d.ts(11,114): error TS2304: Cannot find name ‘HTMLCollection’.

Continue reading

How add all arrays to one in rxjs

Issue how i can add all arrays to one in rxjs for this code? someObs$ = this.getSomeData$().pipe( mergeMap(res => res), groupBy(el => el.class), mergeMap(group$ => group$.pipe(toArray())), // how in this place create something like this: [[{},{}], [{},{}], [{},{}]] shareReplay(1) )

Continue reading

Combine subject and observer in a single subscribe RxJs

Issue I have an Behavior Subject private usersSubject: BehaviorSubject<ActionedUser[]> = new BehaviorSubject([]); public usersChange: Observable<ActionedUser[]> = this.usersSubject.asObservable(); constructor() { } set updatedUsers(users: ActionedUser[]) { this.usersSubject.next(users); } and an Observable getCurrentUser(): Observable<WebAuthUser> { if (environment.production) { return this.http.get<WebAuthUser>(`${this.webAuthURL}/wauth/api/user`, { withCredentials: true

Continue reading

Jest/Rxjs – timeout when calling for subscription from a getter

Issue I have a service that updates an Rxjs Subject whenever a method in the service is called: @Injectable() export class AppAlertService implements IAppAlertService { private readonly _alertBehaviourSubject: Subject<IAlertConfiguration> = new Subject<IAlertConfiguration>(); public get alertConfiguration(): Observable<IAlertConfiguration> { return this._alertBehaviourSubject.asObservable(); }

Continue reading

Wait for observable to complete

Issue I have series of methods which are dependent on completion of other methods. process1(data: string) : Observable<string> { this.dataservice.process(data).subscribe( (response) => { return response.data; } ); } main(data: string) : string { var process1Data: string = process1(data); // I

Continue reading

subscribe observable (as subject)

Issue i have following example code which returns id+1 of it’s elements: EntitiesService: public create(model: Model): Observable<number> { var subject = new Subject<number>(); this.GetAll().subscribe(result => { if (result.find(x => x.name == model.name)) { return; } model.id = result[result.length – 1].id

Continue reading

Property 'subscribe' does not exist on type 'void'.ts(2339).Am getting this error

Issue I am new in angular and am getting this error while implementing subscribe function after calling it from the service.This is component.ts file OnSubmit(){ this.formModal.email=this.profileForm.value.email; this.formModal.name=this.profileForm.value.name; this.formModal.ph=this.profileForm.value.ph; this.formModal.stateValue=this.profileForm.value.stateValue; this.api.postValues(this.formModal).subscribe((data: any)=>{ console.log(data) }) } } //Services export class FormsService {

Continue reading

Why observer method is called twice?

Issue I have the following method that returns observer, but it is called twice: public getClassesAndSubjects(school: number, whenDate: string): Observable<ClassesAndSubjects[]> { console.log(‘1’); const observable = this.classService.GetClassesAndSubjects(school, whenDate); console.log("2"); observable.subscribe(data => { if (!data.hasOwnProperty(‘errors’)) { this.classesSubjects = data; } }, error

Continue reading