我正在使用Angular2(2.3.1)和gridstack.js(gridstack.js 0.3.0)和jquery 1.11.1。试过这个例子
https://stackoverflow.com/questions/39901473/wrap-gridstack-js-into-angular-2-component
让gridstack.js与Angular 2一起使用并获得以下错误:
zone.js:170 Uncaught TypeError:$(...)。gridstack不是一个函数 在HTMLDocument。 (http://localhost:8080/:111:26) at mightThrow(eval at webpackJsonp.87.module.exports(http://localhost:8080/scripts.bundle.js:88:9),:3583:29) at process(eval at webpackJsonp.87.module.exports(http://localhost:8080/scripts.bundle.js:88:9),:3651:12) 在ZoneDelegate.invokeTask(http://localhost:8080/polyfills.bundle.js:16599:31) 在Zone.runTask(http://localhost:8080/polyfills.bundle.js:16398:47) 在ZoneTask.invoke(http://localhost:8080/polyfills.bundle.js:16652:38) at data.args。(匿名函数)(http://localhost:8080/polyfills.bundle.js:17813:29)
不确定如何解决这个问题。任何帮助将不胜感激。
感谢。
答案 0 :(得分:1)
$(...)。gridstack不是函数
gridstack扩展的jQuery库与您在角度组件中使用的jQuery库不同。