Skip to content

Commit 2b68d3b

Browse files
committed
better Ng doc
* fix #2944
1 parent ee1a7cb commit 2b68d3b

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

angular/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ this is the recommended way if you are going to have multiple grids (alow drag&d
88

99
I.E. don't use Angular templating to create grid items as that is harder to sync when gridstack will also add/remove items.
1010

11-
HTML
11+
MyComponent HTML
1212

1313
```html
1414
<gridstack [options]="gridOptions"></gridstack>
1515
```
1616

17-
CSS
17+
MyComponent CSS
1818

1919
```css
2020
@import "gridstack/dist/gridstack.min.css";
@@ -30,7 +30,7 @@ CSS
3030
```
3131

3232

33-
Standalone Component Code
33+
Standalone MyComponent Code
3434

3535
```ts
3636
import { GridStackOptions } from 'gridstack';
@@ -47,7 +47,7 @@ export class MyComponent {
4747
// sample grid options + items to load...
4848
public gridOptions: GridStackOptions = {
4949
margin: 5,
50-
children: [ // or call load()/addWidget() with same data
50+
children: [ // or call load(children) or addWidget(children[0]) with same data
5151
{x:0, y:0, minW:2, content:'Item 1'},
5252
{x:1, y:0, content:'Item 2'},
5353
{x:0, y:1, content:'Item 3'},

demo/index.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,9 @@ <h1>Demos</h1>
4747
</ul>
4848
<h1>Angular wrapper</h1>
4949
<p>We now ship an <a href="https://github.com/gridstack/gridstack.js/tree/master/angular/" target="_blank">Angular Component</a>
50-
to make it supper easy for that framework (Vue and React examples are above)</p>
51-
<p>These are complete Angular projects with multiple options. use `yarn` and `yarn start` in <a href="https://github.com/gridstack/gridstack.js/tree/master/angular/projects/demo" target="_blank">angular demo</a> sub-project to run them</p>
52-
<ol>
53-
<li><a href="../angular/projects/demo/src/app/simple.ts">simple.ts</a></li>
54-
<li><a href="../angular/projects/demo/src/app/ngFor.ts">ngFor.ts</a></li>
55-
<li><a href="../angular/projects/demo/src/app/ngFor_cmd.ts">ngFor with command</a> (not recommended)</li>
56-
<li><a href="../angular/projects/lib/src/lib/gridstack.component.ts">gridstack.component.ts</a> and <a href="../angular/projects/lib/src/lib/gridstack-item.component.ts">gridstack-item.component.ts</a> (BEST)</li>
57-
</ol>
50+
to make it supper easy for that framework</p>
51+
<h1>React wrapper</h1>
52+
<p>React original examples are shown above, but upcoming and better TS based <a href="https://github.com/gridstack/gridstack.js/tree/master/react/" target="_blank">/react</a> folder (working to make that official and ship it) should be looked at instead. </p>
5853
<h1>Old v5.1.1 Jquery Demos</h1>
5954
Note: those are no longer supported, and use an old version of the lib to compare functionality.
6055
<ul>

0 commit comments

Comments
 (0)