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
38
votes
23 answers

Ionic 4: "Loading Controller" dismiss() is called before present() which will keep spinner without dismissing

I used "Ionic Loading Controller" to show a spinner until the data is retrieved then it calls "dismiss()" to dismissed it. it works fine, but sometimes when the app already have the data, the "dismiss()" is called before the "create()" and…
rami bin tahin
  • 1,897
  • 2
  • 10
  • 16
38
votes
8 answers

Angular 6 does not add X-XSRF-TOKEN header to http request

I've read the docs and all the related questions on SO, but still Angular's XSRF mechanism isn't working for me: in no way I can make a POST request with the X-XSRF-TOKEN header appended automatically. I have an Angular 6 app with a login form.…
Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64
38
votes
2 answers

Angular 6: Multiple configurations (twas environments)

Trying to get angular-cli to recognise multiple configurations in angular.json C:\_dev\myapp>ng serve --configuration development Configuration 'development' could not be found in project 'myapp'. Error: Configuration 'development' could not be…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
38
votes
12 answers

Update to Angular v6 - Module not found: Error: Can't resolve 'fs'

I'm trying to migrate my Angular Universal project from Angular v5 to v6 I've got a service where I use fs to load the translation on the server side. Everything works well with Angular v5. With Angular v6, when I run npm run start aka ng serve…
David Dal Busco
  • 7,975
  • 15
  • 55
  • 96
37
votes
5 answers

Angular 6 run a function in every X seconds

I have a function called opensnack(text) { ... }; which is opening an angular material snackbar with the given text input. What I want to do is to call this function like every 10 seconds. How should I do this?
user10037542
36
votes
4 answers

How to navigate to other page in angular 6?

Im trying to redirect my page from login to another page. Im following this code. My login component ts file: import { Router } from '@angular/router'; constructor(private router: Router) { } funLogin(mobilenumber){ …
sasi
  • 836
  • 4
  • 17
  • 33
36
votes
2 answers

Dependency @ng-bootstrap/ng-bootstrap must be explicitly whiteliste

In angular 6 project, I created angular library using angular cli command ng g lierary @some/libName. In my library, I have a component which needs @ng-bootstrap/ng-bootstrap, so I added it by npm i --save @ng-bootstrap/ng-bootstrap. When I try to…
Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132
35
votes
3 answers

Angular : how to call finally() with RXJS 6

I was using RXJS 5, now as I upgraded it to 6, I am facing some problems. Previously I was able to use catch and finally but as per update catch is replaced with catchError (with in the pipe) now how to use finally? Also I have some questions : Do I…
Sunil Kumar
  • 909
  • 2
  • 17
  • 31
34
votes
5 answers

Is there a way to add a type assertion / annotation to a template input variable?

Background I have a template that looks like this (I'm using some component that uses this as the basis for a repeated item, it's the , but the question is not specific about that component, just as an example) For background, let's say…
Eran Medan
  • 44,555
  • 61
  • 184
  • 276
34
votes
1 answer

Angular component default style css display block

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…
Karl Johan Vallner
  • 3,980
  • 4
  • 35
  • 46
34
votes
2 answers

Using scss as default style sheet in Angular 6+ (styleExt)

Apparently the way to declare the default stylesheet extension changed from Angular 6 onwards. The styleExt property in the angular.json is not recognised any longer. For new projects this can be set with an option on the CLI --style=scss on the new…
Daniel Lerps
  • 5,256
  • 3
  • 23
  • 33
34
votes
8 answers

Angular 6 ng lint combineLatest is deprecated

I recently updated from Angular 5 to Angular 6. I'm getting this warning combineLatest is deprecated: resultSelector no longer supported, pipe to map instead. Rxjs is version 6.1.0, tslint is 5.10.0, Angular CLI is 6.0.0 and Typescript 2.7.2. I'm…
Phaze
  • 545
  • 1
  • 5
  • 14
33
votes
2 answers

How do you sort an Observable in Angular 6 with rxjs 6?

I just want to sort data on an observable of my class type 'Category'. So Observable < Category[] > I want to sort. So I upgraded to Angular6 and rxjs6 with it. One issue that is probably simple Typescript that I do know is how do I just do a…
djangojazz
  • 14,131
  • 10
  • 56
  • 94
32
votes
6 answers

Select All mat option and deselect All

I have scenario as below: I want to achieve is: When user click on All then all options shall be selected and when user click All again then all options shall be deselcted. If All option is checked and user click any other checkbox than All then…
Gags
  • 3,759
  • 8
  • 49
  • 96
32
votes
3 answers

What is the proper way to use a dependent npm package in angular 6 library project?

I'm a little confused as to how im supposed to reference external npm packages in my library angular6 project. We have an internal scss library I'd like to use to style my reusable components in my library. How do i go about importing…
cobolstinks
  • 6,801
  • 16
  • 68
  • 97