【发布时间】:2020-02-16 14:13:17
【问题描述】:
我正在尝试使用我现有的应用程序复制以下内容,但它给了我错误。
https://github.com/NorthwoodsSoftware/gojs-angular-basic
错误错误:DIV id 无效;无法获取具有 id 的元素:myDiagramDiv(go.js:12)
DIV id; could not get element with id: myDiagramDiv
at B (go.js:12)
at Bi (go.js:789)
at Fl (go.js:912)
at InspectorComponent.ngAfterViewInit (inspector.component.ts:21)
at callProviderLifecycles (core.js:32327)
at callElementProvidersLifecycles (core.js:32292)
at callLifecycleHooksChildrenFirst (core.js:32274)
at checkAndUpdateView (core.js:44280)
at callViewAction (core.js:44636)
at execComponentViewsAction (core.js:44564)
【问题讨论】:
-
"gojs": "^2.1.0-beta1", "gojs-angular": "^1.0.1", "@angular/common": "~8.2.9", "@角度/编译器": "~8.2.9", "@angular/core": "~8.2.9",
-
在这种情况下第 1 步:尝试控制台
$('#myDiagramDiv').length是否 > 0 ? -
你的 div/ 文档后的 init 函数调用准备好了吗?