Questions tagged [angular10]

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

Breaking Changes:

  • Typescript 3.6, 3.7, and 3.8 are no longer supported. update to Typescript 3.9.
  • Input fields of type number fire the valueChanges event only once per value change (as opposed to twice in some cases). See PR 36087.
  • The minLength and maxLength validators only validate values that have a numeric length property. See PR 36157.
  • Templates with unknown property bindings or unknown element names now log errors instead of warnings. See PR 36399.
  • UrlMatcher can now return null values. See PR 36402.
  • Transplanted views now refresh at insertion point only. See PR 35968.
  • Formatting times with the b or B format codes now supports time periods that cross midnight. See PR 36611.
  • Navigation is canceled for routes with at least one empty resolver. See PR 24621.

See the changelog for latest version information.

Read more at the Angular Website

837 questions
6
votes
1 answer

How can I change a body tag class in Angular 10 (best practice)?

I want to switch between two classes (light and dark) at TAG Body. What I did? I created a service: import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class ThemeService { body = document.body; …
Telmon
  • 91
  • 1
  • 8
6
votes
1 answer

Module Parse Failed With Optional-Chaining in Angular 10 and ES2020

Just updated to Angular 10 from 9.0 Every use of Optional Chaining (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining) in my code now results in its own instance of the following error ERROR in…
JimbobTheSailor
  • 1,441
  • 1
  • 12
  • 21
5
votes
2 answers

ngIf Async Pipe as value with only null check

I have an observable that I would like to create a variable with in the ngIf as well as only return false if the value is null (the observable returns a number) I need to explicitly check for null as my observable can return 0 as a value which…
iamsimonsmale
  • 366
  • 3
  • 14
5
votes
2 answers

Mat table expandable rows doesn't work with mat sort Angular 10

When i sort a column of my mat-table i can no longer extend my rows only about one in two still works. While everything works fine when no sorting is done. I came across this link :…
Jonathan Moy
  • 319
  • 3
  • 9
5
votes
1 answer

Angular 10: CommonJs and AMD Dependencies can cause optimization bailouts, hotkeys.js depends on 'mousetrap'

We are receiving this build warning in Angular 10. How can this be fixed? Is there an alternative NPM like Lodash-es ? hotkeys.js depends on 'mousetrap'. CommonJs and AMD Dependencies can cause optimization bailouts Error Message Resource:…
user13889515
5
votes
2 answers

Angular 10 | ngrx Effects | Unit Tests | Cannot call a class as a function

After upgrading the Angular project to Angular 10, ngRx effects unit tests started breaking. Following is the error after upgrade: Running into the same issue, Follow the solution. Thanks,
Manish Kumar
  • 1,131
  • 15
  • 28
5
votes
2 answers

Angular compiler is slow between two identical model laptops

Coworker and I are trying to figure out why compilation times are different. We have the same exact Dell Laptop 7030 model, same SSD, same hard drive, same memory, specs. Our task manager process look similar. Corporate orders the identical model…
user12425844
4
votes
1 answer

Dynamic from fields using reactive forms in Angular?

I have a scenario like Need to edit the single quotes values (only single quotes values), So I extracted the single quotes values using regex and prepare the reactive dynamic form. onclick of performing edit button will show old step name above, new…
Soumya Gangamwar
  • 954
  • 4
  • 16
  • 44
4
votes
1 answer

Angular Universal Production Build Process

I'm using Angular Universal 10 and I want to prerender my site. I'm confused on the proper build process for a production environment. Angular gives these two commands: "build:ssr": "ng build --prod && ng run…
4
votes
1 answer

SassError Can't find stylesheet to import @import "ionic.globals";

Trying to update my project from ionic 3 to 5 and when i do ionic serve got this: ERROR in ./src/theme/variables.scss…
4
votes
1 answer

The "swiperight" event cannot be bound because Hammer.JS is not loaded

What is the proper configuration for HammerJS in Angular 10/11? We shouldn't import from 'hammerjs' anymore, instead, we should import HammerModule from @angular/platform-browser. This doesn't seem to work. When I try to set up HammerJS like that: …
Sebastian Denis
  • 928
  • 10
  • 20
4
votes
0 answers

Angular skipLocationChange doesn't work with resolver

I am using a resolver resolve: { deviceView: DeviceViewResolverService } , in order to get all necessary data for my component before it is initialized. I also use highcharts and if I call the same URL but want to get a different data from…
Alon
  • 41
  • 4
4
votes
4 answers

Angular NameOf in Component for String Safe and NgOnchanges

What is the best way to compare NgOnChanges, while making it String Type safe in Angular? Currently this is what I am doing. NgOnChanges SimpleChanges variable is datatype : any and accepts any variable name, even if misspelled. Trying to find clean…
user14432516
4
votes
3 answers

"Can't resolve all parameters for service: (?)" when I try to use service from library in Angular 10

In my library I have a service with this code: import { Inject, Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { DataInjectorModule } from '../../data-injector.module'; // @dynamic @Injectable() export…
netdjw
  • 5,419
  • 21
  • 88
  • 162
4
votes
1 answer

Angular router: named outlets does not seem to work with relative routes nor in lazy loaded modules

I have some problems with the angular router and named outlets. I have a list of members, and want to edit a clicked member on the same page in a named router outlet. And I would like to have the member handling in a lazy loaded…
1 2
3
55 56