4

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.

dazzed
  • 643
  • 2
  • 9
  • 19

1 Answers1

2

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 :)

ChrisF
  • 134,786
  • 31
  • 255
  • 325
  • And you'll end up having the entire jQuery library in addition to your Angular libraries, thus easily doubling the size of your dependencies. – Roddy of the Frozen Peas Mar 02 '18 at 02:36
  • 1
    Yes that is true. Since Golden layout havent provided full support with angular 2+. Inorder to use it, we might have to do some hacks – Prabhjyot Gambhir Mar 02 '18 at 02:40
  • There is actually a fully working implementation for Angular2+, see https://stackoverflow.com/questions/52860451/ and https://github.com/EmbeddedEnterprises/ng6-golden-layout – B--rian Nov 16 '18 at 14:20