angular7

Angular Chart.js - Remove Moment.js as Dependency / Reduce Bundle Size

泄露秘密 提交于 2021-01-28 02:06:40
问题 I am using Chart.js with Angualar 7 . But Chart.js adds about 450KB to my bundle size. Through other resources I found out, that Moment.js is the main factor for the big size. "chart.js": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.7.3.tgz", "integrity": "sha512-3+7k/DbR92m6BsMUYP6M0dMsMVZpMnwkUyNSAbqolHKsbIzH2Q4LWVEHHYq7v0fmEV8whXE0DrjANulw9j2K5g==", "requires": { "chartjs-color": "^2.1.0", "moment": "^2.10.2" } }, I want to know how to remove moment

How to show the angular material drop down on mouse over?

南楼画角 提交于 2021-01-27 15:13:53
问题 Now on clicking of the hamburger menu i am getting drop down list instead i need it on mouse hover on hamburger menu here is the stack blitz link. 回答1: You can do this using matMenuTrigger Directive <button mat-icon-button [matMenuTriggerFor]="menu" #menuTrigger="matMenuTrigger" (mouseenter)="menuTrigger.openMenu()"> To hide menu, add mouseleave event for a menu. Bundle all your menu items within a span or div tag. And then attach (mouseleave) event to it <mat-menu #menu="matMenu"

Angular component default style css display block

荒凉一梦 提交于 2021-01-26 03:13:19
问题 I am sick of all my angular elements being 0x0 pixels, because they have names like app-card, app-accordion, which the browser does not recognise as HTML5 compliant elements and as thus, will not give any default styles to. This is means that inspecting it in Chrome, I fail to see the container dimensions and when the DOM is really deep, it is hard to understand which element encompasses which area on the screen, etc. It feels logical to me that all angular elements should be block displayed

App testing return “NullInjectorError: No provider for Location!”

我只是一个虾纸丫 提交于 2021-01-22 05:18:09
问题 Testing an app in Angular 7 with Karma, I can't remove the error in subj. I have searched various places (mostly here) but either the solutions don't work or are not relevant to my case. App.component.html: <app-header></app-header> <router-outlet></router-outlet> Header.component.ts: import { Component, OnInit, ViewChild, ElementRef, AfterViewInit, EventEmitter, Output } from '@angular/core'; import { Router } from '@angular/router'; import { Location } from '@angular/common'; @Component({

App testing return “NullInjectorError: No provider for Location!”

≡放荡痞女 提交于 2021-01-22 05:16:24
问题 Testing an app in Angular 7 with Karma, I can't remove the error in subj. I have searched various places (mostly here) but either the solutions don't work or are not relevant to my case. App.component.html: <app-header></app-header> <router-outlet></router-outlet> Header.component.ts: import { Component, OnInit, ViewChild, ElementRef, AfterViewInit, EventEmitter, Output } from '@angular/core'; import { Router } from '@angular/router'; import { Location } from '@angular/common'; @Component({

My angular 7 apps sitemap.xml is not being picked up by webmaster tools

空扰寡人 提交于 2021-01-21 10:37:27
问题 My angular 7 apps sitemap.xml is not being picked up by webmaster tools I have this sitemap.xml file (I've hidden real names): <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>https://mywebsite.co.uk/</loc> <lastmod>2018-11-28T13:11:30+00:00</lastmod> </url> <

CKEDITOR 5 - Remove “Insert Media” option from ClassicEditor

烈酒焚心 提交于 2021-01-04 18:39:20
问题 I'm using CKEditor 5 in my angular 7 application. ClassicEditor by default shows the Insert Media button on the toolbar as highlighted in the below image. On researching online I found we can disable particular options by using the removePlugins option in the editorConfig like below. editor.component.ts editorConfig = { removePlugins: ['Image'], placeholder: 'Type the content here!' }; Above code is to not remove the Insert Media option but a different option to Insert Image . But it doesn't

Angular multiple http post requests give me error: “net::ERR_INSUFFICIENT_RESOURCES”

最后都变了- 提交于 2021-01-01 06:59:04
问题 I am importing an .xlsx file, which has 6000 customers inside and I am trying to loop throught customers and make an http post request foreach customer, but I get this error: net::ERR_INSUFFICIENT_RESOURCES. How can I insert these customers? They need to be passed throught my backend in order to get encrypted. this.customers.forEach(customer => { this.customerService .createCustomer(customer) .pipe(take(1)) .subscribe(() => {}); }); Only 2000 customers are imported. Any way to fix it? Thanks.

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

与世无争的帅哥 提交于 2020-12-28 21:00:54
问题 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 Can't find a way to get tsconfig.json path mapping works

柔情痞子 提交于 2020-12-28 21:00:14
问题 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/*": [