Skip to content

Commit d05351d

Browse files
authored
Merge pull request #2784 from adumesny/master
angular 12 readme fixes
2 parents a31dbcb + 8438711 commit d05351d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

angular/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ Code ship starting with v8.1.2+ in `dist/angular` for people to use directly and
172172
- gridstack v8 to run as it needs the latest changes (use older version that matches GS versions)
173173
- Angular 13+ for dynamic createComponent() API
174174

175+
NOTE: if you are on Angular 12 or below: copy the wrapper code over (or patch it - see main page example) and change `createComponent()` calls to use old API instead:
176+
```ts
177+
protected resolver: ComponentFactoryResolver,
178+
...
179+
const factory = this.resolver.resolveComponentFactory(GridItemComponent);
180+
const gridItemRef = grid.container.createComponent(factory) as ComponentRef<GridItemComponent>;
181+
```
182+
175183
## ngFor Caveats
176184

177185
- This wrapper handles well ngFor loops, but if you're using a trackBy function (as I would recommend) and no element id change after an update,

0 commit comments

Comments
 (0)