草庐IT

my_module

全部标签

javascript - '类型错误 : undefined is not a function' when jumping 'tween modules

我在Node中不断遇到这个问题,每当我相互调用函数时,我的应用程序就会崩溃。我已经做了这个最小的工作示例(按照它的方式工作给了我错误):启动模块varmodule2=require('./module2');vardata='data';module2.doStuff(data);模块2varmodule3=require('./module3');functiondoStuff(data){//Stuffhappensto'data'module3.takeStuff(data);}functiondoSomethingElse(data){console.log(data);}mo

javascript - 导入节点模块时出现流错误 "cant resolve module"

我最近将此添加到我的流程配置中,因为大量与流程拾取的节点模块相关的错误[ignore].*/node_modules/.*这解决了那些错误,但引入了新错误。现在,我导入的每个模块都会导致错误,其中流程表示它无法解决它,因此让我认为这是由于我添加的忽略规则造成的。有没有办法解决这个问题,因为这里删除这一行只会引入不同类型的错误,保留它仍然会出错。 最佳答案 现在有点晚了,但对于以后遇到这个问题的任何人来说:你不应该忽略你的node_modules文件夹。Flow应该从该文件夹中读取并分析其中的文件。

javascript - 类型错误 : module is not a function AngularJS & Jasmine

在我的示例应用程序中,我像这样测试运行器收藏夹Controller:varmodule=angular.module('AngularSampleApp',[]);varFavoritesController=module.controller('FavoritesController',functionfavoritesController($scope){$scope.phones=[{'name':'NexusS','snippet':'FastjustgotfasterwithNexusS.'},{'name':'MotorolaXOOM™withWi-Fi','snippet

javascript - 网页包 2 : cannot resolve module

我有这样一个项目:root/webpack-config.jsapp/app.jsjs/dep.jscore/module.js这是webpack配置文件:module.exports={entry:'./app/app.js',output:{path:__dirname,filename:"[name]-bundle.js"},module:{loaders:[{test:/\.js$/,loader:'babel-loader',exclude:/node_modules/}]},resolve:{modulesDirectories:['core']}...在app.js中,我

javascript - 使用 Webpack 时 Typescript 编译器 "cannot find module"需要 CSS/图像 Assets

我正在编写vanillaJavascript,但使用Typescript编译器的checkJs选项在VSCode中进行类型检查。我将Webpack设置为加载各种Assets类型(CSS、图像等),这对于构建工作正常,但代码将这些语句视为错误。例如,在这段代码中require("bootstrap");require("bootstrap/dist/css/bootstrap.css");varimg=require("../img/image.png");第一行很好,但接下来的两行都在require()的(字符串)参数下显示错误,工具提示为“找不到模块(名称)”。我已经安装了@type

javascript - jshint 错误 : Cannot find module 'underscore'

我的grunt任务似乎运行得非常好,但每次运行它时我都会收到此错误:Loading"jshint.js"tasks...ERROR>>Error:Cannotfindmodule'underscore'有什么办法可以找出为什么会这样吗?我可以看到/grunt-contrib-jshint目录位于/node_modules目录中。有什么原因找不到underscore模块吗?我试过运行npminstall但在运行grunt时我仍然遇到同样的错误。有什么想法吗?感谢您的帮助。 最佳答案 当您遇到找不到模块x错误时,有时可能会有所帮助的一件

javascript - 错误 : $injector:modulerr Module Error with ui-router

我不知道是什么问题div#wrapper(ng-app="adminApp")....js/varadminApp=angular.module('adminApp',['ui-router']);如果我用varadminApp=angular.module('adminApp',[]);错误消失这是为什么?更新:从控制台添加图片 最佳答案 模块名称是ui-router但你需要注入(inject)ui.router而不是ui-routervaradminApp=angular.module('adminApp',['ui.route

javascript - Angular : Why is my event handled twice?

我有三个Controller:main、product、customer。ControllerA是我的“主页”的一部分。ControllerB和C取决于位置。Controller主要:varMainController=function($scope,$location,$rootScope,ToolbarService){$scope.addClicked=function(){ToolbarService.onAddButtonClick();};};app.controller({MainController:MainController});产品:varProductContr

javascript - 剧情 js : how to run my javascript ONLY after plot image is loaded

当通过JavascriptAPI(plotly.js,而不是plotly-nodejs)使用任何类型的plotly图表时,我如何才能在图表加载后运行一些javascript?我正在寻找plotlyjavascriptAPI中的机制,例如,在使用GoogleMapsAPI时,它与“addListenerOnce”结合“tilesloaded”或“ready”执行相同的操作。例如,假设我想在呈现https://plot.ly/~PlotBot/685处显示的示例后立即简单地显示一个警报,其html和js代码可以在https://plot.ly/~PlotBot/685.js查看.这样做的原

javascript - 为什么这个被屏蔽的 JS 代码在 GET 参数 : '*alert(13)*' executed on my page?

我们对我们的网站进行了白帽扫描,他们返回的漏洞之一是我们的URL附加了whscheck'*alert(13)*'a/。当我们运行完整的URL(https://oursite.com/phorders3/index.php/whscheck'*alert(13)*'a/)时,网站会加载并发出带有值的警报13流行音乐。谁能解释这是如何工作的?星号和a/到底在做什么? 最佳答案 您页面中的代码在Javascript的字符串文字中使用URL中的值,而没有正确转义该值。这意味着任何人都可以将Javascript放在URL中,它就会在页面中执行