angular6

Angular 6 - compare two observables lengths

纵然是瞬间 提交于 2021-01-27 07:34:46
问题 Is there a way to compare the current length of two observables? EDIT: It is to compare the arrays withing the observables. I want to compare all the elements count withing them(See example below). At the point I am trying to do it, they are already completely loaded. Not waiting on any data. For example I want to do: if (array1.length < array2.length) { array1.foreach(item => item.isSelected = true); I tried using pipe, map, tap , but they resolve after some time and don't work for me. I

Angular 6 - compare two observables lengths

时光毁灭记忆、已成空白 提交于 2021-01-27 07:29:09
问题 Is there a way to compare the current length of two observables? EDIT: It is to compare the arrays withing the observables. I want to compare all the elements count withing them(See example below). At the point I am trying to do it, they are already completely loaded. Not waiting on any data. For example I want to do: if (array1.length < array2.length) { array1.foreach(item => item.isSelected = true); I tried using pipe, map, tap , but they resolve after some time and don't work for me. I

Hide IE warnings from console in Angular 6

冷暖自知 提交于 2021-01-27 06:06:16
问题 I am constantly getting these warnings when serving my angular app: e.g.: ./src/app/core/containers/navbar/navbar.component.sass (Emitted value instead of an instance of Error) autoprefixer: ...src\app\core\containers\navbar\navbar.component.sass:11:4: grid-auto-columns is not supported by IE Unfortunately, I am not interested in IE support. Is it possible to disable this type of warnings? 回答1: You can disable warnings for single lines in your CSS file by prepending the line with: /*

Hide IE warnings from console in Angular 6

风格不统一 提交于 2021-01-27 06:03:43
问题 I am constantly getting these warnings when serving my angular app: e.g.: ./src/app/core/containers/navbar/navbar.component.sass (Emitted value instead of an instance of Error) autoprefixer: ...src\app\core\containers\navbar\navbar.component.sass:11:4: grid-auto-columns is not supported by IE Unfortunately, I am not interested in IE support. Is it possible to disable this type of warnings? 回答1: You can disable warnings for single lines in your CSS file by prepending the line with: /*

Hide IE warnings from console in Angular 6

*爱你&永不变心* 提交于 2021-01-27 06:03:23
问题 I am constantly getting these warnings when serving my angular app: e.g.: ./src/app/core/containers/navbar/navbar.component.sass (Emitted value instead of an instance of Error) autoprefixer: ...src\app\core\containers\navbar\navbar.component.sass:11:4: grid-auto-columns is not supported by IE Unfortunately, I am not interested in IE support. Is it possible to disable this type of warnings? 回答1: You can disable warnings for single lines in your CSS file by prepending the line with: /*

ng-select multi select checkbox with reactive forms in angular 6

本秂侑毒 提交于 2021-01-26 07:30:21
问题 Please go through the link(https://ng-select.github.io/ng-select#/multiselect-checkbox) to know ng-select multi select checkbox. I am trying to use the ng-select "Group selects children" in my angular 6 application. I am having problem using ng-select "Group selects children" with Reactive Forms instead of template driven forms. I have tired it as <ng-select [items]="userGroupsList" [multiple]="true" bindLabel="name" groupBy="gender" [selectableGroup]="true" [selectableGroupAsModel]="false"

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

Angular 6 HttpInterceptor - when getting 401 refresh the token and create the same request

℡╲_俬逩灬. 提交于 2021-01-24 07:46:04
问题 I'm using the HttpInterceptor in Angular 6, and trying to built a refresh token mechanisim: When httpClient request get's 401 status code (unauthorised) the HttpInterceptor will create a request that will refresh the token, it will update the headers of the first request and call it again with the new token. The code is working until the stage that I need to recall the original request again with the new token that got from the refresh token request. This is my code: export class

404 when Deploying Angular 6 app to github pages

浪尽此生 提交于 2021-01-23 11:13:06
问题 My application works fine when served locally. I have compiled the build with no errors. Site link is here - https://evilernie44.github.io/users/index.html When I try to load the site via the github page, I get a 404 on my get requests. I have tried adding a 404.html and then copying the contents of index.html to it as suggested by angular docs but I still cannot seem to get it to work. I am at a loss as regards to what to do next, does anyone have any suggestions. 回答1: If the root of an

Service instantiated twice after APP_INITIALIZER

送分小仙女□ 提交于 2021-01-23 06:22:13
问题 Problem is: I need to make an http call and store an object that is needed for generate dynamic routes. So, I was taking advantage of the APP_INITIALIZER. // app.module.ts import { ApplicationService } from './application.service'; providers: [ ApplicationService, { provide: APP_INITIALIZER, useFactory: appServiceFactory, deps: [Injector, ApplicationService], multi: true }, ], function appServiceFactory(injector: Injector, appService: ApplicationService): Function { return () => { return