Skip to content

Commit cbf736b

Browse files
committed
more changes for compatibility with gojs-angular 2.0
1 parent a89f010 commit cbf736b

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"sourceMap": false,
4141
"extractCss": true,
4242
"namedChunks": false,
43-
"aot": true,
43+
"aot": false,
4444
"extractLicenses": true,
4545
"vendorChunk": false,
4646
"buildOptimizer": true,

src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ <h1>GoJS / Angular - Components Sample</h1>
33
<div class="left">
44
Palette
55
<gojs-palette #myPalette [initPalette]='initPalette' [divClassName]='paletteDivClassName' [nodeDataArray]='state.paletteNodeData'
6-
[modelData]='state.paletteModelData' (modelChange)='paletteModelChange($event)' [skipsPaletteUpdate]='state.skipsPaletteUpdate'></gojs-palette>
6+
[modelData]='state.paletteModelData'></gojs-palette>
77
</div>
88

99
<div class="left">

src/app/app.component.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ export class AppComponent {
5353
},
5454
{ points: new go.List(/*go.Point*/).addAll([new go.Point(20, 20), new go.Point(60, 20), new go.Point(60, 40), new go.Point(60, 50)]) }
5555
],
56-
paletteModelData: { prop: 'val' },
57-
skipsPaletteUpdate: false
56+
paletteModelData: { prop: 'val' }
5857
};
5958

6059
public diagramDivClassName: string = 'myDiagramDiv';
@@ -187,18 +186,6 @@ export class AppComponent {
187186

188187
return palette;
189188
}
190-
191-
// When the palette model changes, update app data to reflect those changes. Be sure to use immer's "produce" function to preserve immutability
192-
public paletteModelChange = function(changes: go.IncrementalData) {
193-
this.state = produce(this.state, draft => {
194-
// set skipsPaletteUpdate: true since GoJS already has this update
195-
// this way, we don't log an unneeded transaction in the Palette's undoManager history
196-
draft.skipsPaletteUpdate = true;
197-
draft.paletteNodeData = DataSyncService.syncNodeData(changes, draft.paletteNodeData);
198-
draft.paletteLinkData = DataSyncService.syncLinkData(changes, draft.paletteLinkData);
199-
draft.paletteModelData = DataSyncService.syncModelData(changes, draft.paletteModelData);
200-
});
201-
};
202189

203190
constructor(private cdr: ChangeDetectorRef) { }
204191

src/tsconfig.app.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"outDir": "../out-tsc/app",
55
"types": []
66
},
7+
"angularCompilerOptions": {
8+
"enableIvy": false
9+
},
710
"exclude": [
811
"test.ts",
912
"**/*.spec.ts"

0 commit comments

Comments
 (0)