angular7

Angular 7 - How to load material snackbar when checkbox checked in datatable

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 11:37:39
问题 I have created datatable with checkbox. When user select checkbox, snackBar must be load (currently working good) with length of selected checkbox. But snakcbar loading everytime when user select more than one checkbox. How to load snackbar and just show length of selected ids.(without load snackbar everytime). Snackbar just need to show increment of selected ids. I push selected ids in public endorsementIds: string[] = []; . If endorsementIds length is 0, snackbar must hide. Here is my code

angular append component to respective tabs

笑着哭i 提交于 2019-12-10 10:55:59
问题 I am trying to append component (dynamic created) to respective tabs using angular material and @viewChild but it is going to first tab only when I click button in the 2nd tab. Here is Stackblitz - angular-append-component-to-respective-tabs It's not displaying in individual tab. I have 3 tabs. all 3 tabs contains Add button, when I click on 1st tab's button, it's adding that component in 1st tab but when I click on 2nd tab's Add button, it's adding that component in 1st tab only, it should

cdk virtualscroll with mat-grid-list

风流意气都作罢 提交于 2019-12-10 10:28:47
问题 Is there an virtual scroll implementation that works with the grid-list? I think the default implementation won't work because each row should have an element around it. I'm using the grid-list to display profile pictures, and need an infinite scroll or preferably virtual scroll to load new ones. 回答1: So since cdk virtualscroll doesn't support multi column, I ended up using ngx-virtual-scroller, which does support multi-columns. The mat-grid-list I also had to let go because of this, but,

Angular 7 select dropdown object is empty when not touched

两盒软妹~` 提交于 2019-12-09 18:43:44
问题 In my application, ngOnInit() loads currencies, categories, and manufacturers. I am using Angular 7 reactive forms for this. Data loads as expected and dropdowns populated with values and the first option selected and showed to the user. So, here is the problem, after finishing form and clicking on submit (using default dropdown values), I see an empty object for the category , currency , and manufacturer . ProductNewComponent.ts import {Component, OnInit} from '@angular/core'; import {Router

Angular 7 routerLink directive warning 'Navigation triggered outside Angular zone'

[亡魂溺海] 提交于 2019-12-09 07:58:59
问题 I am struggling with Angular framework to get my application run smoothly, but I can't resolve an issue with routing. I have a top level AppComponent and app-routing.module.ts which manage the navigation via my custom SlideMenuComponent . My simplified html template of AppComponent : <app-slide-menu [buttons]="menuButtons"></app-slide-menu> <router-outlet></router-outlet> My SlideMenuComponent has the following html as its core: <nav><div *ngFor="let button of buttons"> <a routerLink="{

how to show loading indicator on page loading in angular 7 until all apis response?

非 Y 不嫁゛ 提交于 2019-12-09 06:35:13
问题 I have 5 api calls in a page. some apis take 20 sec to give response. some take 30 sec to give response. some take 10 sec so, when first api gives its response, first api sets loading indicator false. then loading indicator disppears. But other apis are still working I want to show loading indicator until the five api calls response. can you please give me some idea to do the task. code: component.ts loading = true; ngInit() { this.api1(); this.api2(); this.api3(); this.api4(); this.api5(); }

Errors: Data path “.builders['app-shell']” should have required property 'class'

我与影子孤独终老i 提交于 2019-12-09 04:05:37
问题 I am getting this error while running my application. Here are the details of my application. I have already tried cache clean. 回答1: In your package.json change the devkit builder. "@angular-devkit/build-angular": "^0.800.1", to "@angular-devkit/build-angular": "^0.10.0", it works for me. good luck. 回答2: Following worked for me npm uninstall @angular-devkit/build-angular npm install @angular-devkit/build-angular@0.13.0 回答3: Everyone here is focusing on downgrading @angular-devkit/build

Navigate in Angular 7 without adding parameter to URL

时光毁灭记忆、已成空白 提交于 2019-12-08 17:11:52
问题 I want to navigate between two routes in Angular 7 with posting data between them. But I don;t want to show those parameter in URL. How to do it in proper way? at this moment I am strugging with something like this: this.router.navigate(['/my-new-route', {data1: 'test', test2: 2323, test: 'AAAAAAA'}]); and it change my url to http://localhost:4200/my-new-route;data1=test;test2=2323;test=AAAAAAA how to do it to cancel those data from url: http://localhost:4200/my-new-route Edit: My case: /form

Angular 7 how to use fs module?

主宰稳场 提交于 2019-12-08 16:49:38
问题 I'm using Angular 7. I tried to use fs module on Typescript for open a directory. I always have this error: "Module not found: Error: Can't resolve fs" types@node and file-system are installed. My code: import {Component, OnInit} from '@angular/core'; import * as fs from 'file-system'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit { title = 'my-app'; constructor() { } ngOnInit() {

How to make real time search box, in angular 7 cli project

断了今生、忘了曾经 提交于 2019-12-08 11:31:31
问题 I want to make search box in angular 7 cli project. My project back-end was asp.net core web api. i will show array of data set, i want to make search box in angular front-end application. how to make that. angular 7 cli Below array of data come from asp.net web api [ { "productId": 1, "productName": "product 1", "productPrice": 500, "productDescription": "Des 1 enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni.", "productCategory": "cat 1",