Questions tagged [angular7]

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

Questions about Angular version 7, the web framework from Google. Angular version 7 entered a 3 year Long Term Support period on July 1, 2018.

See the changelog for what changed in version 7.

If you need help upgrading from version 7 to version 8, please see the Official Angular upgrade guide

5213 questions
28
votes
1 answer

Ngx translate with shared/lazy loading modules

Probably one of the most common questions, while the documentation and some other questions I found try to clear up things for me, yet I am still not sure how to fix this. So this is my structure: App module is of course the main module that is…
CularBytes
  • 9,924
  • 8
  • 76
  • 101
27
votes
4 answers

Angular 7 - service worker not registered

I did everything as written in "https://angular.io/guide/service-worker-getting-started" to make my application PWA. Used exactly this commands: ng add @angular/pwa npm install http-server -g ng build --prod http-server -p 8080 -c-1 dist Then I…
tzm
  • 588
  • 1
  • 12
  • 27
25
votes
2 answers

How to check if an input field is in focus in Angular 7

I have a form and I want to know if any of the input fields in the form are focused or not? I read the 'NgForm' documentation but didn't find anything related to 'focus'. I found touched but it doesn't satisfy needs.
Ajeet Eppakayala
  • 1,186
  • 1
  • 10
  • 17
25
votes
5 answers

How can I set my reactive form date input value?

So I am trying to display this date for an input. But it's not displaying when setting the value of it in my form builder group. I would also like to be able to format it too. this.post.startDate is of type Date Whats in .ts this.editForm =…
Jade
  • 431
  • 1
  • 4
  • 10
25
votes
5 answers

reset paginator first page angular material

I am trying to go to the first page of the mat-paginator, that is, reset the pagination, but it does not work. Any idea how it can be solved? My html is such that
MGs
  • 453
  • 1
  • 5
  • 7
25
votes
5 answers

Angular Material styles not being applied correctly

Any ideas why the angular material styles are not being applied correctly? I know there are a lot of questions on this but I can't seem to find one that resolved my problem. I have used angular material with no problem for several projects but can't…
MadMac
  • 4,048
  • 6
  • 32
  • 69
25
votes
7 answers

Use font awesome 5 on angular material 7

I'm using angular 7.0.1 and angular material 7.0.2, I want to add the font awesome 5.4.2 icons and I'm trying to follow the steps on fontawesome web but I can't get the font awesome icon font. first: npm install --save-dev…
Alex
  • 1,230
  • 2
  • 24
  • 46
24
votes
5 answers

Angular 7 - Multiple outlets : Error: Cannot activate an already activated outlet

Here is the issue that I'm encountering with Angular 7 : I have two outlets : the main app router outlet, and a secondary outlet named 'administration'. When I want to navigate through any administration link at start, it works fine. But next time,…
Anthony Coucke
  • 251
  • 1
  • 2
  • 5
24
votes
4 answers

Angular 7: NullInjectorError: No provider for PagerService

I am trying to implement pagination but It's not working. Here is my code: pager.service.ts: import * as _ from 'underscore'; @Injectable({ providedIn: 'root', }) export class PagerService { getPager(totalItems: number, currentPage:…
user10791322
24
votes
5 answers

Angular 7 routerLink directive warning 'Navigation triggered outside Angular zone'

I am struggling with Angular framework to get my application run smoothly, but I can't resolve an issue with routing. I have a top level AppComponent and app-routing.module.ts which manage the navigation via my custom SlideMenuComponent. My…
23
votes
1 answer

Web worker setup in Angular 7.0.1

I am trying to do web-worker setup in my existing Angular 7.0.1 project (medium scale project). I did the setup after going through the following links: Web workers setup for Angular 4 app Webpack config change for Angular 6+ app - library and…
Mr_Green
  • 40,727
  • 45
  • 159
  • 271
22
votes
2 answers

npm install shows error with git not found

I have recently added some dependencies to the package JSON and tried installing npm, but it shows errors related to git not found: npm ERR! path git npm ERR! code ENOENT npm ERR! errno ENOENT npm ERR! syscall spawn git npm ERR! enoent Error while…
Harikrishnan C U
  • 239
  • 1
  • 2
  • 5
22
votes
3 answers

How to use DecimalPipe from component in angular?

I have a requirement that I have to convert the number using the decimal pipe from ts Instead of use decimal pipe like this {{rmanFmvRulesDef.max | number :'1.2-2'}} I want to manipulate it from the component, can anyone please help me?
Soumya Gangamwar
  • 954
  • 4
  • 16
  • 44
21
votes
6 answers

Angular2 - How to use string enums with *ngIf

How do I pass enum to a function when I use *ngIf in Angular? I have the follow code: export enum RoleType { User='User', Admin='Admin' } component function public hasAccess(role: RoleType) { //check role type and return true or…
Danny
  • 9,199
  • 16
  • 53
  • 75
21
votes
7 answers

cdk-virtual-scroll-viewport with variable item heights

I would like to use cdk-virtual-scroll-viewport in a TimeLine view with items of different heights. So setting itemSize="x" which, according to the documentation refers to The size of the items in the list (in pixels), is unpractical. autosize is…
yglodt
  • 13,807
  • 14
  • 91
  • 127