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
53
votes
4 answers

How to add/set environment Angular 6 angular.json file

How do I specify the environment to use in Angular 6+? The .angular-cli.json file seems to have changed to angular.json from previous versions and with it the structure of the json within. How/where in this file do I specify the environments to use?
Danoram
  • 8,132
  • 12
  • 51
  • 71
51
votes
5 answers

Angular HttpClient missing response headers

I am trying to get into angular lately. I have a paginated request. const myParams = new HttpParams().set('page', page.toString()).set('size', size.toString()); this.http.get>('https://localhost:8443/user/', { headers: new…
Mr.H.
  • 965
  • 1
  • 10
  • 18
51
votes
5 answers

Angular 6+ :ProvidedIn a non root module is causing a circular dependency

I'm trying to provide a resolve service via the new providedIn attribute. This is a translations resolver which I use in a protected module: import { Injectable } from '@angular/core'; import { Observable , pipe } from 'rxjs'; import {map}…
Rot-man
  • 18,045
  • 12
  • 118
  • 124
51
votes
7 answers

Angular Service Worker SwUpdate.available not triggered

I'm having a hard time integrating angulars service worker into my application. I followed the guide and it works so far. I can create a shortcut on my homescreen and launch into my app. The problem is that my app somehow doesn't update. If I change…
user9973068
49
votes
6 answers

How to reload or refresh only child component in Angular 8

I have two components, One parent and Other Child. HTML Part
47
votes
12 answers

Angular 6 error show to 'mat-form-field' is not a known element:

Hi I am using angular 6 and my code is as follows: import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import {…
Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
46
votes
11 answers

refreshing the page results in 404 error- Angular 6

I am building an application with the help of Angular6 and facing problems in routing. All the routes are working when I click on a particular tab but whenever I refresh the current page, it is throwing 404 error. I have seen many posts regarding…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
44
votes
15 answers

Jquery not working in angular 6 Error: ENOENT: no such file or directory, open '...\node_modules\jquery\dist\jquery.min.js'

I am in process migrating Angular 5 project to Angular 6. While starting application by npm start getting the below error ** Angular Live Development Server is listening on localhost: 9000, open your browser on http://localhost:9000/ ** 91%…
MPPNBD
  • 1,566
  • 4
  • 20
  • 36
43
votes
21 answers

Bootstrap not working properly in Angular 6

I started learning Angular and I'm following a tutorial. I tried putting the code as in the tutorial for the navigation-bar:
42
votes
8 answers

Expression has changed after it was checked. Previous value: 'ng-valid: true'. Current value: 'ng-valid: false'

I have angular reactive form in parent component and sections inside childrens component. Inside the child component I have a checkbox - when its checked - more fields open and I want them all to be required. I am using setValidators but I'm getting…
Livnat Menashe
  • 831
  • 2
  • 9
  • 17
42
votes
4 answers

angular router navigate then reload

So I want to reload the app after navigating to a specific route .. I use router.navigate to navigate to certain route based on user role and that works fine but I have to reload the page after routing if coming from sign in page (not every time…
Omar Abdelhady
  • 1,528
  • 4
  • 19
  • 31
42
votes
4 answers

What is the equivalent to AngularJS's ngcookie in Angular 6?

How can you create cookies in Angular 6? For AngularJS there was ngcookie. What is the equivalent way to create cookies in Angular 6?
Akshay
  • 621
  • 1
  • 5
  • 15
39
votes
2 answers

What is state management in angular? and why should I use it?

I am new to Angular and this question might be very broad. But I am interested in learning more on State management usage. Recently one of our project implemented state management using NGXS library. However I am trying to understand what are all…
ac184
  • 811
  • 2
  • 10
  • 19
39
votes
9 answers

How to add external js file in angular 6 library

I am creating an angular library (version 6) which is based on angular material for which I need to include the hammer js library. I know that in angular 6 we can add the external js library in the angular.json under the project's configuration.…
nikhil
  • 823
  • 1
  • 7
  • 19
39
votes
8 answers

Angular 6 Services: providedIn: 'root' vs CoreModule

With Angular 6, below is the preferred way to create singleton services: import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root', }) export class UserService { } From Angular doc: When you provide the service at the root…
Manish Jain
  • 9,569
  • 5
  • 39
  • 44