【发布时间】:2017-03-23 09:07:15
【问题描述】:
我知道以前有人问过这个问题,但我似乎无法弄清楚。
我有一个非常简单的项目设置,我想将 Kendo UI 与 AngularJS 一起使用,并将其与 Webpack 捆绑在一起。
代码如下:
app.js
import * as $ from 'jquery';
import 'angular';
import 'kendo-ui-core';
var app = angular.module('app', ['kendo.directives']);
index.html
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body ng-app="app">
<input kendo-date-picker />
<script src="bundle.js"></script>
</body>
</html>
webpack.config.js
var webpack = require('webpack');
module.exports = {
entry: "./app.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" }
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
'window.jQuery': "jquery"
})
]
};
但是当我运行应用程序时,我收到以下错误消息:
The Kendo UI directives require jQuery to be available before AngularJS.
Please include jquery before angular in the document.
我不确定这里的问题是什么..有人吗?
【问题讨论】:
标签: angularjs kendo-ui webpack