![](/img/trans.png)
[英]Why does Angular say “Uncaught ReferenceError: $scope is not defined”?
[英]Uncaught ReferenceError: say is not defined
我尝试将我的function hello()
从 hello.js 导入到我的页面 sign_up.liquid。 我浏览了我的 main.js 以获得一个 bundle.js( browserify ./public/js/main.js -o ./public/js/bundle.js
)但我有一个未捕获的 ReferenceError 。 为什么我不能在 sign_up.liquid 中使用我的function hello()
?
--hello.js
var hello = function(){
console.log('I said Hello')
}
module.exports = hello;
--main.js
const say = require('./hello.js')
--bundle.js
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
var hello = function(){
console.log('I said Hello')
}
module.exports = hello;
},{}],2:[function(require,module,exports){
const say = require('./hello.js')
},{"./hello.js":1}]},{},[2]);
--sign_up.liquid
[...]
<script src="../js/bundle.js"></script>
<script>
say.hello();
<script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.