angular-ivy

Angular: strictTemplates - How to set boolean and numbers in Templates properly?

依然范特西╮ 提交于 2021-02-10 15:47:21
问题 I set strictTemplates:true and use in a HTML template the following <textarea matInput matAutosizeMaxRows="4" matTextareaAutosize="true" I receive from the compiler error TS2322: Type 'string' is not assignable to type 'number'. error TS2322: Type 'string' is not assignable to type 'boolean'. But how to set it properly in the HTML-Templates (to avoid the error)? 回答1: Wrap the property name in brackets. If you leave the brackets, the values will be interpreted as strings. With brackets, the

Angular Ivy strictTemplates true Type 'boolean | null' is not assignable to type 'boolean'

若如初见. 提交于 2021-02-07 20:30:26
问题 I've updated my app to 9 version. Everything is alright but I've problem with strictTemplates set to true. For instance this code loaded$: Observable<boolean> [loaded]="loaded$ | async" @Input() loaded!: boolean; I've got the error Type 'boolean | null' is not assignable to type 'boolean'. This fix the error @Input() loaded!: boolean | null; But I cant see the point someone acn explain me, please? 回答1: the reason is because the async pipes return signature is something like <T>(input$:

What does Angular Ivy specifically allow us to do in regards to manual change detection?

浪子不回头ぞ 提交于 2021-02-06 08:58:11
问题 This article mentions that Ivy opens a few possibilities for the future though. It should now be possible to run an application without zone.js, and to semi-manually handle change detection (a bit like you would with React). These APIs already exist but are experimental, not documented, and will probably change in the near future. I think it was already possible to run an application without zone.js prior to Ivy. Does Ivy allow to semi-manually handle change detection? Where are those

What does Angular Ivy specifically allow us to do in regards to manual change detection?

隐身守侯 提交于 2021-02-06 08:57:38
问题 This article mentions that Ivy opens a few possibilities for the future though. It should now be possible to run an application without zone.js, and to semi-manually handle change detection (a bit like you would with React). These APIs already exist but are experimental, not documented, and will probably change in the near future. I think it was already possible to run an application without zone.js prior to Ivy. Does Ivy allow to semi-manually handle change detection? Where are those

Jasmine Angular 9 test failing because 'unreachable' stack trace at injectableDefOrInjectorDefFactory

牧云@^-^@ 提交于 2020-12-08 06:47:06
问题 I created an Angular application under 4. I have migrated from version to version and am currently latest version 9. I was reviewing my tests. I have a Login component that I had 3 working tests and now all are failing. It is now returning the following: LoginComponent should be created ... Failed: unreachable Error: unreachable at injectableDefOrInjectorDefFactory (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:17302:1) at providerToFactory

Why entryComponents is not necessary anymore in Angular 9/ivy compiler?

隐身守侯 提交于 2020-12-02 01:49:30
问题 Can anyone give a clear explanation of why in the IVY compiler, entry components API Is not necessary anymore?. In other words what was change internally so that Angular suddenly doesn't need a heads up that you are going to create component dynamically 回答1: ViewEngine Prior to Ivy, ViewEngine compiler performed the whole program analysis based on NgModule configurations and html template and then produced module and component factories based on this global transitive information. This means

Angular compilation fails after upgrade to Angular v9 and enabling Ivy

安稳与你 提交于 2020-05-27 04:19:50
问题 We have recently upgraded our angular app to the latest version of Angular (Angular v9). All our dependencies are also upgraded, "ng update" says all our dependencies are "in order". When we build the application with Ivy enabled the compilation process fails with a ton of errors, which we've never encountered before: "angularCompilerOptions": { "enableIvy": true } Some of the errors are very odd, saying that you can't bind 'ngClass' or 'ngModel' since it's not a know property of 'div'. It

Angular compilation fails after upgrade to Angular v9 and enabling Ivy

孤街浪徒 提交于 2020-05-27 04:19:05
问题 We have recently upgraded our angular app to the latest version of Angular (Angular v9). All our dependencies are also upgraded, "ng update" says all our dependencies are "in order". When we build the application with Ivy enabled the compilation process fails with a ton of errors, which we've never encountered before: "angularCompilerOptions": { "enableIvy": true } Some of the errors are very odd, saying that you can't bind 'ngClass' or 'ngModel' since it's not a know property of 'div'. It

Cannot combine @Input decorators with query decorators using Ivy

天大地大妈咪最大 提交于 2020-05-09 05:54:07
问题 I have migrated my angular 7 app to 8.0.0 and i'am now trying the new compiler ivy. The app works perfectly without ivy but when i try to compile with it i have the following error : Cannot combine @Input decorators with query decorators No line number , no file , nothing ... hard to debug anything. I have warning just before that , but i don't know if it's related : WARNING in Entry point 'angular-tree-component' contains deep imports into 'lodash/defaultsDeep', 'lodash/get', 'lodash/omit',