Property 'withComponents' does not exist on type 'typeof AgGridModule' - ag-grid-angular

I am using AG Grid in my Angular application and since upgrading from v27 to v28 I get the following error in my app.
Error: src/app/app.module.ts:18:18 - error TS2339: Property 'withComponents' does not exist on type 'typeof AgGridModule'.
I thought this was required when providing your own custom components to AG grid?

Since v28 the AgGridModule no longer needs the .withComponents() method as all user applications will now be using Ivy. The method used to handle registering custom components as EntryComponents but that is no longer required with Ivy and was deprecated by Angular.
So to fix this error make the follow change and your custom components will still work.
- AgGridModule.withComponents([CustomComp]);
+ AgGridModule
See the AG Grid Docs on Angular Compatibility for more details.

Related

"TypeError: container is undefined" when selecting element created with sceneBuilder using AggregatedView

I'm getting Uncaught TypeError: container is undefined thrown in a loop when I create a custom geometry.
Geometries are created using code from https://forge.autodesk.com/blog/custom-models-forge-viewer
I'm using the AggregatedView. The error does not occur when I instantiate a GuiViewer3D directly.
Uncaught TypeError: container is undefined
getFragmentConsolidationType ConsolidationIterator.js:398
updateRenderProxy ConsolidationIterator.js:416
updateRenderProxy RenderModel.js:973
updateSelectionProxies Viewer3DImpl.js:2145
renderOverlays Viewer3DImpl.js:2152
cmdRenderOverlays Viewer3DImpl.js:1330
executeCommandList Viewer3DImpl.js:913
tick Viewer3DImpl.js:1908
animloop Viewer3DImpl.js:1939
Is this a bug in Autodesk Forge? Using version 7.80
Selecting a custom geometry with the AggregatedView.
Expected the object to be selected.
Instead an error is thrown continuously.
The engineering team confirmed that this is a problem with the SceneBuilder extension not being compatible with "model consolidation" - a process where multiple meshes are merged into a single GPU buffer to improve rendering performance. The AggregatedView class consolidates models automatically, which is why you're running into this issue.
While we are not planning to add consolidation support to models generated by the SceneBuilder extension, we will update the extension and make sure that this combination is handled gracefully. In the meantime, if you need to use SceneBuilder models in an AggregatedView app, please unconsolidate your custom models using model.unconsolidate().

Upgraded to angular 9.1 - error is Property 'supportsDOMEvents'

Here is the issue
error TS2416: Property 'supportsDOMEvents' in type 'ɵangular_packages_platform_browser_p
latform_browser_o' is not assignable to the same property in base type 'ɵDomAdapter'.
As #DrTeeth already mentioned, it's hard to help w/o any further infos.
But I've had a similar problem and want to share what had helped for me: This was a simple inconsistency of my dependencies. I', using a 3rd party Angular Component Library which was incompatible with the newer (Ivy-enabled) version, after I updated Angular itself. For me, the error message had some details about the package in question and after updating it, too, everything worked fine.

#grapecity/wijmo throwing run time error after upgrading my Angular project from 8 to 9

Recently iam trying to update my angular project from 8 to 9. While updating i also updated wijmo from wijmo/wijmo to #grapecity/wijmo package as it supports IVY.
But after the completing the upgradation, i can able to compile the application but i am getting the following error at run time
global-error-handler.service.ts:43 Error: Uncaught (in promise): TypeError: (0 , t[n]) is not a function
TypeError: (0 , t[n]) is not a function
at backend.js:61
at Reflect.<anonymous> (backend.js:61)
at push../node_modules/#grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js.__decorate (index.js:28)
at index.js:53
at Object../node_modules/#grapecity/wijmo.angular2.grid.detail/__ivy_ngcc__/index.js (index.js:53)
at __webpack_require__ (bootstrap:84)
I'd like to get some more info about this error. The quick thing to check is property initialization order. In Ivy, the properties are interpreted as they are specified in markup (previously wijmo controlled how they were interpreted). So you can break components by setting certain properties before others.
For example, if I tried to set the selectedIndex on a combobox BEFORE I set the data source, then the app would break at runtime because there are no items in the list to select yet.
More info here: https://www.grapecity.com/wijmo/docs/GettingStarted/Angular-Components#property-initialization-order-in-angular-9-ivy-and-higher
The next thing to check is component decorators (if you are inheriting our components). There are some breaking changes in decorators in Ivy.
For example, you might need to add {descendants: true} to ContentChildren queries.
Or you might need to add an #Injectable decorator to your class.
You can read more about breaking changes in Ivy and how to fix them here: https://angular.io/guide/ivy-compatibility-examples
But please feel free to contact us to work directly: wijmoexperts#grapecity.com

Angular/Pug - Can't bind to 'ngforOf' since

This code is throwing exception
Uncaught Error: Template parse errors: Can't bind to 'ngforOf' since
it isn't a known property of 'mat-card'.
1. If 'mat-card' is an Angular component and it has 'ngforOf' input, then verify that it is part of this module.
div
button(mat-raised-button, color='primary', (click)='createMocked()') Create Mocked
div
mat-card.Class(*ngfor="let room of rooms; let classroomIndex = index; trackBy: trackClass")
if I will add quotes then I'm missing support from Intellij
Does anyone have idea how to fix 1 and 2 or have woking in intellij reference that I can check?
I used this article: https://medium.com/#MarkPieszak/using-pug-or-jade-templates-with-the-angular-cli-9e37334db5bc
The error
Template parse errors: Can't bind to 'ngforOf' since it isn't a known
property
means that Angular template parser tries to find a directive based on your ngforof attribute but it can't since Angular template syntax is case-sensitive.
You have to write *ngFor= so it will converted to ngForOf and Angular will be able to find dedicated ngForOf directive.
If you're curious how Angular transforms structural directives into ng-template syntax then check this out:
https://alexzuza.github.io/ng-structural-directive-expander/

Unable to use HTML form validators for Angular AoT - "property 'required does not exist"

I'm attempting to build an Angular 2 project, using angular-cli with the --prod and --aot arguments. The build is failing with the following error:
Property 'required' does not exist on type '{ [key: string]: any; }'.
In my HTML, I'm using HTML validation on some of my inputs (required, pattern attributes).
Using JIT compilation, these work as expected. It is only during AoT compilation that the errors occur.
Has anyone seen this before? I was hoping not to have to resort to defining all of my forms using the ReactiveForms method and using the Angular Validators, unless there's no way around it.
The following are some things that will make AoT compile fail.
Don’t use require statements for your templates or styles, use styleUrls and templateUrls, the angular2-template-loader plugin will change it to require at build time.
Don’t use default exports.
Don’t use form.controls.controlName, use form.get(‘controlName’)
Don’t use control.errors?.someError, use control.hasError(‘someError’)
Don’t use functions in your providers, routes or declarations, export a function and then reference that function name
#Inputs, #Outputs, View or Content Child(ren), Hostbindings, and any field you use from the template or annotate for Angular should be public