草庐IT

top_module

全部标签

javascript - Typescript 和 webstorm,缺少 --module 标志

在WebStorm中编辑在VisualStudio上创建的typescript项目时,会出现以下错误:Error:(1,1)TS1148:Cannotcompileexternalmodulesunlessthe'--module'flagisprovided.代码很简单:在文件Test.ts中classhelloWorld{}export=helloWorld;预先感谢您的帮助已编辑我忘了说我用的是MAC。同样在进入帖子后,在我寻求解决方案的过程中,我尝试在VisualStudioCodeforMac中编译网页,我在那里遇到了同样的问题,那个,让我意识到问题不是IDE,而是一些东西共

javascript - Angular JS 错误 : [$injector:nomod] Module 'portfolioMockupApp.services' is not available

我正在尝试使用Karma编写一些单元测试,但收到以下错误:PhantomJS1.9.8(MacOSX)错误错误:[$injector:nomod]模块“portfolioMockupApp.services”不可用!您要么拼错了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。http://errors.angularjs.org/1.3.3/$injector/nomod?p0=portfolioMockupApp.services在/Users/danielbogart/Documents/coding/work/portfolio-mockup/bower_

javascript - Webstorm IDE 和 AngularJS angular.module 未解析的方法

我正在为AngularJS项目使用WebstormIDE。我已经将AngularJS添加到库和自动完成等。工作正常。但是,WebstormIDE没有找到非常重要的函数angular.module()。我已经尝试了所有方法(重新安装等),但似乎仍然无法正常工作。有什么想法吗? 最佳答案 到目前为止,WebStormIDS没有任何进展ticket上面由@AllYouCanEat86引用,所以我不确定是否应该在不向WebStorm添加库的情况下修复它。一旦我遵循了thisanswer中给出的建议我的问题已解决,并且不再在WebStorm中

javascript - 在向下滚动之前,页面加载时显示粘性 "back to top"按钮

我按照教程获得了一个粘性的“返回顶部”按钮,该按钮会在您向下滚动时出现。出于某种原因,当您在页面首次加载后位于页面顶部时,它会显示。如果向下滚动,然后一直向上滚动,它就会消失(应该如此)。但最初它表现不正常。有什么想法吗?这是我正在使用它的实时页面,您可以在右下角看到它:http://willryan.usHTMLBacktotop$(document).ready(function(){//Showorhidethestickyfooterbutton$(window).scroll(function(){if($(this).scrollTop()>200){$('.go-top'

javascript - 为 Angular JS 启用 html 5 模式会抛出 JS 错误 : Failed to instantiate module due to: TypeError: Cannot read property 'html5Mode' of undefined

如何为AngularJS启用html5模式?'usestrict'varblogApp=angular.module('blogApp',['ngRoute']).config(['$routeProvider',function($routeProvider,$locationProvider){$routeProvider.when('/disclaimer',{templateUrl:'templates/disclaimer.html',controller:'DisclaimerCtrl'});$routeProvider.otherwise({redirectTo:'/'}

javascript - 如何使用 type=module 脚本中的代码

这个问题在这里已经有了答案:ES6Modules:Undefinedonclickfunctionafterimport(4个答案)关闭4年前。我不明白为什么这个微不足道的代码不起作用:index.html:ShowMessageshowImport.js:importshowMessagefrom'/show.js';functionshowImportedMessage(){showMessage();}show.js:exportdefault"WhydoIneedthis?";exportfunctionshowMessage(){alert("Hello!");}它由NPMh

javascript - 模块构建失败(来自 ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-react'

在尝试使用Webpack4和Babel7构建React应用程序时,我遇到了以下错误。ERRORin./src/index.jsModulebuildfailed(from./node_modules/babel-loader/lib/index.js):Error:Cannotfindmodule'babel-preset-react'from'/Users/me/Desktop/reflask'-Ifyouwanttoresolve"react",use"module:react"-Didyoumean"@babel/react"?atFunction.module.exports[

javascript - require.js 未捕获类型错误 : cannot read property '__module_path__; of undefined

所以我刚刚开始尝试掌握require.js,但它似乎不起作用。当我使用标签将其包含在我的html中时:在chrome中加载页面时出现以下错误UncaughtTypeError:Cannotreadproperty'__MODULE_PATH__'ofundefined->require.js:538在firefox中我得到一个稍微不同的错误:TypeError:parentisundefined->require.js:538不知道我怎么会导致这个问题,因为它是require.js的全新安装,我的main.js中还没有代码。提前致谢 最佳答案

javascript - window.parent.location.href 或 window.top.location 哪个更好

我在一个项目中工作,在特定情况下我必须在错误页面上重定向。为此,我创建了Error.aspx页面。现在我正在使用window.top.location.href="../Error.aspx"并生成http://localhost/app_web/Error.aspx并且它的工作正常,除了一次(显示消息http://xyz/ErrorPage.aspx'不存在。)。那么任何人都可以建议哪个是更好的选择。谢谢 最佳答案 top“优于”parent如果您的目的是将您的页面framebust到顶层,因为您的页面可能位于一个框架内,而该框架

javascript - Node JS 在 module.exports 中调用一个 "local"函数

如何在module.exports声明中从另一个函数中调用一个函数?我有MVC结构Nodejs项目和一个名为TestController.js的Controller。我想在Controller中访问方法,但是使用this关键字会出现以下错误:cannotcallmethodgetNameofundefined"usestrict"module.exports={myName:function(req,res,next){//accessingmethodwithincontrollerthis.getName(data);},getName:function(data){//code}