From 2b68d3b2239d5c40c0f50c4d5234909c058c40f2 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Fri, 14 Feb 2025 15:34:11 -0800 Subject: [PATCH] better Ng doc * fix #2944 --- angular/README.md | 8 ++++---- demo/index.html | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/angular/README.md b/angular/README.md index 38fb8ac41..587370453 100644 --- a/angular/README.md +++ b/angular/README.md @@ -8,13 +8,13 @@ this is the recommended way if you are going to have multiple grids (alow drag&d I.E. don't use Angular templating to create grid items as that is harder to sync when gridstack will also add/remove items. -HTML +MyComponent HTML ```html ``` -CSS +MyComponent CSS ```css @import "gridstack/dist/gridstack.min.css"; @@ -30,7 +30,7 @@ CSS ``` -Standalone Component Code +Standalone MyComponent Code ```ts import { GridStackOptions } from 'gridstack'; @@ -47,7 +47,7 @@ export class MyComponent { // sample grid options + items to load... public gridOptions: GridStackOptions = { margin: 5, - children: [ // or call load()/addWidget() with same data + children: [ // or call load(children) or addWidget(children[0]) with same data {x:0, y:0, minW:2, content:'Item 1'}, {x:1, y:0, content:'Item 2'}, {x:0, y:1, content:'Item 3'}, diff --git a/demo/index.html b/demo/index.html index 164079bef..ed3b6b780 100644 --- a/demo/index.html +++ b/demo/index.html @@ -47,14 +47,9 @@

Demos

Angular wrapper

We now ship an Angular Component - to make it supper easy for that framework (Vue and React examples are above)

-

These are complete Angular projects with multiple options. use `yarn` and `yarn start` in angular demo sub-project to run them

-
    -
  1. simple.ts
  2. -
  3. ngFor.ts
  4. -
  5. ngFor with command (not recommended)
  6. -
  7. gridstack.component.ts and gridstack-item.component.ts (BEST)
  8. -
+ to make it supper easy for that framework

+

React wrapper

+

React original examples are shown above, but upcoming and better TS based /react folder (working to make that official and ship it) should be looked at instead.

Old v5.1.1 Jquery Demos

Note: those are no longer supported, and use an old version of the lib to compare functionality.