Questions tagged [angular6]

Questions about Angular version 6, the web framework from Google. Use this tag for Angular questions which are specific to only version 6. Use tag Angular for any Angular questions which are not specific to an individual version.

Questions about Angular version 6, the web framework from Google.

You can read more about Angular version 6 here

You can find Angular version 6 official documents here

7869 questions
24
votes
7 answers

How to filter a mat-tree component Angular Material 6.0.1

I'm using mat-tree angular material component. It's a nice component with some very useful features like, multi-select, expand all/collapse all. I was not able to find any tree filtering feature in any of their APIs. Has anyone came across this…
SatAj
  • 1,899
  • 4
  • 29
  • 47
23
votes
1 answer

Angular component naming limitations - 'selector [your component name] is invalid'

In Angular 6 (6.0.7) I'm trying to generate a component via the CLI. I type in ng g c t1-2-3-user and get the error message Selector (app-t1-2-3-user) is invalid. Is there something inherently not allowed in this name? I've already created a parent…
Kyle Vassella
  • 2,296
  • 10
  • 32
  • 62
23
votes
4 answers

How to keep observable alive after error in RxJS 6 and Angular 6

Can anyone help with the scenario where this._getReactions$.next() not working whenever this.http.get(...) gets an error. I want to keep observable alive to take the next input. private _getReactions$: Subject = new Subject(); …
Krishna
  • 760
  • 3
  • 14
  • 30
23
votes
6 answers

How to disable a checkbox based on conditions in angular 6?

My html code,
sai
  • 487
  • 1
  • 7
  • 16
23
votes
3 answers

Upgrade from Angular 5.2 to 6.1

I am upgrading to Angular 6, but it looks like i get an error when running ng serve or ng build. I do get the following error Cannot destructure property 'createHash' of 'undefined' or 'null'. TypeError: Cannot destructure property…
stian64
  • 1,563
  • 3
  • 12
  • 25
23
votes
3 answers

How can I set Angular 6 Material sidenav to open right to left from the right side of the screen

This is the code example being used in angular Material for Sidenav. Im using this very same example on my page. However, I could find any instructions how to open the sidenav from left to right from the right side of the screen. Anybody knows how…
Carl.G
  • 257
  • 1
  • 3
  • 6
23
votes
2 answers

WebStorm - Argument type {providedIn: "root"} is not assignable to parameter type {providedIn: Type | "root" | null} & InjectableProvider

I'm trying to migrate my app from Angular v5 to v6 and I face the following typescript error while trying to specify providedIn in my providers Argument type {providedIn: "root"} is not assignable to parameter type {providedIn: Type | "root" |…
David Dal Busco
  • 7,975
  • 15
  • 55
  • 96
22
votes
7 answers

How to give session idle timeout in angular 6?

We are maintaining a session based on user role. We want to implement timeout functionality when the session is idle for 5 min. We are using @ng-idle/core npm module to do that. My Service file: import { ActivatedRouteSnapshot } from…
viki
  • 361
  • 2
  • 7
  • 17
22
votes
7 answers

How To Change itemsPerPageLabel in mat-paginator in Angular 6+

I am using Angular 6.0.3 with Angular Material 7.1.0, I have my paginator in a separate component (that is not the app.component). What I have tried so far: Created separate ts file called myPagniator.ts: import {MatPaginatorIntl} from…
Edward Sun
  • 277
  • 1
  • 2
  • 11
22
votes
8 answers

Cannot read property 'ngMetadataName' of undefined

I am using Angular 6 with Angular Material. After updating to the latest version, the console is throwing this error in development. On Production it is working Cannot read property 'ngMetadataName' of undefined It occurs when I am trying to open…
Aslam
  • 9,204
  • 4
  • 35
  • 51
22
votes
8 answers

Angular 6: Property 'catch' does not exist on type 'Observable'?

I am upgrading my app to Angular 6. I am upgrading from Angular 4, but the code below is causing errors in Angular 6, where it worked fine in Angular 4. The errors I am getting: Property 'of' does not exist on type 'typeof Observable' Error:…
Shubham Verma
  • 8,783
  • 6
  • 58
  • 79
21
votes
5 answers

In Angular 6 how make case insensitive url pattern?

In my case I want to support same url in case insensitive manner. Example: it should support all url localhost:1029/documentation localhost:1029/DOCUMENTATION localhost:1029/DOCUMENTAtion localhost:1029/docuMENTATION
Jitendra
  • 213
  • 1
  • 2
  • 5
21
votes
1 answer

NullInjectorError: No provider for AnimationBuilder in Angular 6

Hello I working with the Angular 6 And also with the material design I have included all the dependency of the material and also of the animations as well It's not giving error at time of the compilation but I get following error at time of…
Nitin
  • 881
  • 2
  • 10
  • 37
20
votes
4 answers

After installing a CDK of angular getting an error during compilation

ERROR in node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts:29:9 - error TS1086: An accessor cannot be declared in an ambient context. 29 get enabled(): boolean; ~~~~~~~…
RBC
  • 478
  • 1
  • 3
  • 12
20
votes
5 answers

compare two dates in Angular 6

I am new to angular 6 ,Here I need to compare to date inputs and find the greatest one. input 1 : 2018-12-29T00:00:00 input 2 : Mon Dec 31 2018 00:00:00 GMT+0530 (India Standard Time) Here I received the input 1 from mssql database and the input 2…
Zhu
  • 3,679
  • 14
  • 45
  • 76