angular7

Angular 7 Can't find a way to get tsconfig.json path mapping works

大憨熊 提交于 2020-12-28 21:00:12
问题 I've started an angular 7 project and I'm trying to configure the "path mapping" on angular.json to change my import way from this: import { environment } from '../../../environments/environment'; to this: import { environment } from '@environments/environment'; I've done this config on the root level tsconfig.json file: "compilerOptions": { "baseUrl": "src", // This must be specified if "paths" is. ... "paths": { "@app/*": ["app/*"], "@config/*": ["app/_config/*"], "@environments/*": [

Angular 7 scroll event does not fire

╄→尐↘猪︶ㄣ 提交于 2020-12-28 07:53:26
问题 For implementing a spy nav bar in my Angular app in a MatDialog component. I implemented a directive to spy for the scroll event using @HostListener('window:scroll', ['$event']) I also tried 'scroll' as event name. But the event does not seem to fire. I tried several approaches, e. g. by using the HostListener directly in the dialog component, by using the JavaScript window.onscroll() function and the rxjs fromEvent() function but without success. Trying other css events (e. g. window:click )

Angular 7 scroll event does not fire

北城以北 提交于 2020-12-28 07:46:50
问题 For implementing a spy nav bar in my Angular app in a MatDialog component. I implemented a directive to spy for the scroll event using @HostListener('window:scroll', ['$event']) I also tried 'scroll' as event name. But the event does not seem to fire. I tried several approaches, e. g. by using the HostListener directly in the dialog component, by using the JavaScript window.onscroll() function and the rxjs fromEvent() function but without success. Trying other css events (e. g. window:click )

NullInjectorError: No provider for InjectionToken angularfire2.app.options

好久不见. 提交于 2020-12-20 20:13:49
问题 I'm trying to insert the form data in cloud Firestore database. Below is my x.component.ts file in which I'm getting error at constructor where I'm writing private firestore: AngularFireStore import { Component, OnInit } from '@angular/core'; import { GroupService } from '../shared/group.service'; import { NgForm } from '@angular/forms'; // import { NullTemplateVisitor } from '@angular/compiler'; import { AngularFirestore } from '@angular/fire/firestore'; // import { AngularFireModule } from

NullInjectorError: No provider for InjectionToken angularfire2.app.options

和自甴很熟 提交于 2020-12-20 20:11:51
问题 I'm trying to insert the form data in cloud Firestore database. Below is my x.component.ts file in which I'm getting error at constructor where I'm writing private firestore: AngularFireStore import { Component, OnInit } from '@angular/core'; import { GroupService } from '../shared/group.service'; import { NgForm } from '@angular/forms'; // import { NullTemplateVisitor } from '@angular/compiler'; import { AngularFirestore } from '@angular/fire/firestore'; // import { AngularFireModule } from

Drag and drop with pinch zoom doesn't work as expected

半世苍凉 提交于 2020-12-16 04:37:41
问题 In the zoomed mode for pinch-zoom the drag doesn't align properly with the mouse pointer. I've detailed the problem here:https://stackblitz.com/edit/angular-t7hwqg I expect the drag to work same way irrespective of the zoom. I saw in version 8 of angular material they have added @Input('cdkDragConstrainPosition') constrainPosition: (point: Point, dragRef: DragRef) => Point, which will solve my problem as in the zoomed mode I can write a custom logic to map the drag properly with pointer, but

Drag and drop with pinch zoom doesn't work as expected

扶醉桌前 提交于 2020-12-16 04:37:35
问题 In the zoomed mode for pinch-zoom the drag doesn't align properly with the mouse pointer. I've detailed the problem here:https://stackblitz.com/edit/angular-t7hwqg I expect the drag to work same way irrespective of the zoom. I saw in version 8 of angular material they have added @Input('cdkDragConstrainPosition') constrainPosition: (point: Point, dragRef: DragRef) => Point, which will solve my problem as in the zoomed mode I can write a custom logic to map the drag properly with pointer, but

Sharing Data between Components (Angular 7)

↘锁芯ラ 提交于 2020-12-11 04:42:27
问题 I am currently trying to send data between components via a data service using "BehaviorSubject". In the first component, I am updating the messageSoruce and in the second component , retrieving the data but it is empty. I checked that the value "this.card.img" is not empty. What am I missing ? Data Service import { Injectable } from '@angular/core'; import { BehaviorSubject, Subject } from 'rxjs'; @Injectable() export class DataService { private messageSource = new BehaviorSubject("")

Sharing Data between Components (Angular 7)

对着背影说爱祢 提交于 2020-12-11 04:40:48
问题 I am currently trying to send data between components via a data service using "BehaviorSubject". In the first component, I am updating the messageSoruce and in the second component , retrieving the data but it is empty. I checked that the value "this.card.img" is not empty. What am I missing ? Data Service import { Injectable } from '@angular/core'; import { BehaviorSubject, Subject } from 'rxjs'; @Injectable() export class DataService { private messageSource = new BehaviorSubject("")

Angular mat-table pagination not working, entire data is loaded on First page of mat-table

半城伤御伤魂 提交于 2020-12-11 02:36:06
问题 I have use Angular Material table, i have bind data source from ts file,but all the data is loaded on very first page, pagination is not working.I have two more table, which are on same page,same problem for other tables too. I have tried setTimeout(() => this.dataSource.paginator = this.paginator); and ngAfterViewInit() { this.dataSource.paginator = this.paginator } HTML: <mat-table class="mt-4 table-container" fxFlex="100" [dataSource]="allUsers"> <ng-container matColumnDef="checked"> <mat