Golden Layout Anulgar 2+ / ng-golden-layout

痞子三分冷 提交于 2019-11-30 18:20:54

问题


I would like to start by saying that I'm a junior Front-End Developer. So, not much experience with Angular.

So I've been trying to get something to work in Angular 2 with golden layout, my final goal is to reproduce the drag functionality from this module, as represented here: http://golden-layout.com/examples/#d508753b29c3001c24218bf3a6b25141

Since there's no official support for Angular 2 so far, I've been looking for a way to implement that and I came across the module @goldsam/ng-golden-layout

It's an unoficial release of golden layout for angular 2, and I've been trying to create a demo app using this module, but can't seem to get it to work, I'm stuck with this errors:

ERROR in C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (14,16): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (63,79): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (133,45): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (629,22): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (718,16): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (723,22): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (728,26): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (770,16): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (775,21): Cannot find name 'JQuery'. C:/Users/user/Desktop/golden-layout/demo/node_modules/golden-layout/index.d.ts (780,21): Cannot find name 'JQuery'.

So my question is if any of you guys had got this module to work in some demo app that I could use as a start, or if any of you gurus could make a review at my code:

https://github.com/dazzzed/ng-gl-demo

Thanks in advance.


回答1:


Yes this problem came with me even, i just imported Jquery inside app module like this

import * as Jquery from 'jquery';

Similarly you might have to import Goldenlayout.

This will fix your problem :)



来源:https://stackoverflow.com/questions/44954533/golden-layout-anulgar-2-ng-golden-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!