我正在尝试使用 angularjs 和 webpack 运行简单的应用程序,这是我的代码:
index.html
<html ng-app="myApp">
<head>
<meta charset="utf-8">
</head>
<body ng-controller="mainCtrl">
Full Name: {{firstName + " " + lastName}}
<script type="text/javascript" src="bundle.js" charset="utf-8"></script>
</body>
</html>
应用程序.js
var app = angular.module('myApp', []);
function mainCtrl($scope) {
$scope.firstName="John",
$scope.lastName="Doe"
}
Webpackconfig.js
module.exports = {
entry: './main.js',
output: {
filename: './bundle.js'
}
};
main.js
var jquery = require("//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js");
var angular = require("//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular.min.js");
var app = require("./app.js");
捆绑.js
?? I don't know what i sholud write here !!
我也看到了这个:https
://github.com/jeffling/angular-webpack-example
问题是我怎样才能正确运行它?