angular7

Use font awesome 5 on angular material 7

邮差的信 提交于 2020-04-08 01:51:18
问题 I'm using angular 7.0.1 and angular material 7.0.2, I want to add the font awesome 5.4.2 icons and I'm trying to follow the steps on fontawesome web but I can't get the font awesome icon font. first: npm install --save-dev @fortawesome/fontawesome-free then in styles.scss add: @import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; and in _variables.scss add: $fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; now in app.component.ts add: import { MatIconRegistry } from "

Use font awesome 5 on angular material 7

五迷三道 提交于 2020-04-08 01:49:01
问题 I'm using angular 7.0.1 and angular material 7.0.2, I want to add the font awesome 5.4.2 icons and I'm trying to follow the steps on fontawesome web but I can't get the font awesome icon font. first: npm install --save-dev @fortawesome/fontawesome-free then in styles.scss add: @import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; and in _variables.scss add: $fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; now in app.component.ts add: import { MatIconRegistry } from "

Cannot find control with path: 'plans -> 0'

随声附和 提交于 2020-03-28 06:53:08
问题 I have an API that returns the data something like but the class is same but number of entries changes. HTML file: <div class="col-12 col-md-6" formArrayName="plans"> <div class="form-check" *ngFor="let plan of plans; index as i" [formGroupName]="i"> <label class="form-check-label fw7 h5 mb0"> <input class="form-check-input" type="checkbox" formControlName="checkbox"> {{plan.planCode}} </label> <label *ngIf="plan.divisions.length > 0"> Divisions <select class="form-control" formControlName=

Not getting opened on first click when putting primeng toast on shared component in angular 6

丶灬走出姿态 提交于 2020-03-25 18:36:20
问题 I have used prime ng and put this in shared component so that I can share this p-toast where ever I want but when I am click from parent component to open p-toast it is not getting opened on first click, click on second time it gets opened Parent-component.html <app-modal [keydata]='c' [modalData]="modalData" [data]="selectedRowForDelete" (onConfirmModal)="onConfirm($event)" ></app-modal> Parent-component.ts export class CustomComponentsComponent implements OnInit { @ViewChild(ModalComponent

Angular 7 Hide bootstrap modal in typscript

怎甘沉沦 提交于 2020-03-05 09:34:21
问题 I want to call (click)="basicModal.hide()" methode of MDBootstrap Modal inside one of my fuctions in my typescript component. I don't know how to access this method from component. <button type="button" mdbBtn color="primary" class="relative waves-light" (click)="basicModal.show()" mdbWavesEffect>Launch demo modal</button> <div mdbModal #basicModal="mdbModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myBasicModalLabel" aria-hidden="true"> <div class="modal-dialog" role=

Angular 2+ - Tree table using API

 ̄綄美尐妖づ 提交于 2020-02-25 04:03:50
问题 I have three Apis for categories,subcategories and policies. For eg: "https://restapi.com/project". 1. Category In the case of category, I have to pass the body(raw data) as above json for the above Api { "startIndex":"1", "count":"150", "groupBy":"category", "searchTerm":"PROJECT:project1" } Api Response : Listed out all categories { "data": [ { projectName:null, categoryName: category1, subCategoryName:null, controlName:null }, { projectName:null, categoryName: category2, subCategoryName

Uncaught ReferenceError: __importDefault is not defined

喜欢而已 提交于 2020-02-23 09:14:50
问题 I am new to angular. I encounter this error in my index.component.ts file. Uncaught ReferenceError: __importDefault is not defined Error screenshot attached 回答1: The following error is due to a bad version of typescript. You have to downgrade it. Uncaught ReferenceError: __importDefault is not defined Go to your package.json file and downgrade it to 3.5.3 : "devDependencies": { // ... "typescript": "3.5.3" } 回答2: I got this problem when upgrading from 8 to 9, thought it was a bug and even

How to disable url changes with Angular routing

扶醉桌前 提交于 2020-02-22 10:57:15
问题 My Angular 7 app needs to be rendered in an iFrame. Due to the peculiar nature of the system, I need to prevent the URL from changing, or maybe I should say that I need Angular not to expect the URL to change. I've found posts that show how to prevent it on specific routing calls, but the URL is updated when the app loads too. The objective is to maintain the URL like: website.com/applicaition, even when the route changes such that there is no update to the window.location. https://website

On Key `Enter` trigger click event on active list item Angular

浪子不回头ぞ 提交于 2020-02-07 02:33:07
问题 I made a horizontal scroll with resources in it. I'm using the arrow key to navigate in the list, now I want to open that particular highlight list by clicking enter. Component.ts arrowkeyLocation = 0; @HostListener('document:keydown', ['$event']) keyDown(event: KeyboardEvent, resource): void { if (event.keyCode === 37 && this.arrowkeyLocation > 0) { this.arrowkeyLocation--; } if (event.keyCode === 39 && this.arrowkeyLocation < this.searchData.toArray().length - 1 ) { this.arrowkeyLocation++;

server sent events creates way too many listeners for single client

家住魔仙堡 提交于 2020-02-05 03:51:56
问题 I am using server sent events in MEAN stack. I am able to push data from server to client whenever required. But one thing i noticed that even if i am the only client hitting the server. There are multiple listeners for me and events are broadcast to say 40 listeners ( if i wait long enough for the client to reconnect 40 times ). Multiple listeners are also created when user reloads . How can i limit the listeners to say 1 listener to per event per client . Is this even possible with server