You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnw.id;// or use index if no id is set and you only modify at the end...
32
32
}
33
33
```
34
34
HTML
@@ -50,3 +50,8 @@ to build the demo, go to demo/angular and run `yarn` + `yarn start` and Navigate
50
50
- This wrapper needs v7.1.2+ to run as it needs the latest changes
51
51
- 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, you must manually call the `Gridstack.update()` method directly.
52
52
- The original client list of items is not updated to match **content** changes made by gridstack (TBD later), but adding new item or removing (as shown in demo) will update those new items. Client could use change/added/removed events to sync that list if they wish to do so now.
53
+
- Code isn't compiled into a side lib to use right now - you need to copy those files for now. Let me know (slack) if you are using it...
54
+
55
+
thank you!
56
+
Would appreciate getting help doing the same for React and Vue (2 other popular frameworks)
Copy file name to clipboardExpand all lines: demo/angular/src/app/ngFor.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ let ids = 1;
14
14
<p><b>ngFor</b>: Example using Angular ngFor to loop through items and create DOM items. This track changes made to the array of items, waits for DOM rendering, then update GS</p>
15
15
<button (click)="add()">add item</button>
16
16
<button (click)="delete()">remove item</button>
17
-
<button (click)="change()">modify item</button>
17
+
<button (click)="modify()">modify item</button>
18
18
<button (click)="newLayout()">new layout</button>
19
19
<div class="grid-stack">
20
20
<!-- using angular templating to create DOM, otherwise an easier way is to simply call grid.load(items)
@@ -107,7 +107,7 @@ export class AngularNgForTestComponent implements AfterViewInit {
107
107
this.items.pop();
108
108
}
109
109
110
-
publicchange(){
110
+
publicmodify(){
111
111
// this will only update the DOM attr (from the ngFor loop in our template above)
112
112
// but not trigger gridstackItems.changes for GS to auto-update, so call GS update() instead
<p><b>ngFor CMD</b>: Example using Angular ngFor to loop through items, but uses an explicity command to let us update GS (see automatic better way)</p>
15
15
<button (click)="add()">add item</button>
16
16
<button (click)="delete()">remove item</button>
17
-
<button (click)="change()">modify item</button>
17
+
<button (click)="modify()">modify item</button>
18
18
<div class="grid-stack">
19
19
<!-- using angular templating to create DOM, otherwise an easier way is to simply call grid.load(items) -->
20
20
<div
@@ -94,7 +94,7 @@ export class AngularNgForCmdTestComponent implements AfterViewInit {
94
94
}
95
95
96
96
// a change of a widget doesn´t change to amount of items in ngFor therefore we don´t need to do it through the zip function above
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "gridstack",
3
-
"version": "7.1.1-dev",
3
+
"version": "7.1.2",
4
4
"description": "TypeScript/JS lib for dashboard layout and creation, responsive, mobile support, no external dependencies, with many wrappers (React, Angular, Vue, Ember, knockout...)",
0 commit comments