草庐IT

selected_module

全部标签

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 - 如何使用 Javascript 或 jQuery 在选项属性中添加 "selected"?

下面是选择选项的代码,并使用数据库中的php生成,我尝试使用jQuery或任何javascript将selected="selected"添加到value="4":AfghanistanAlbaniaAlgeriaMalaysiaMaldives我试着引用这个post但仍然不能..下面是我当前的脚本:localStorage.setItem("Select1","Malaysia");$('#countryselect').find('option').each(function(i,e){if($(e).val()==localStorage.getItem("Select1")){

javascript - ng-selected 在选择元素中不起作用

我有一个绑定(bind)选择但是当c.CollegeName==collegeSelection.CollegeName都匹配时,项目仍然没有被选中。文档似乎没有帮助。有任何想法吗? 最佳答案 ng-selected应在中使用标记,不在中标签。仔细看看它的doc和例子。因为select指令对所选选项的确定基于ngModel.因此,一旦删除ng-selected="c.CollegeName==collegeSelection.CollegeName",您的代码应该可以工作。我创建了一个非常简单的plunk演示select中的“选定”

javascript - 错误 :Property 'select' does not exist on type HTMLElement

functioncopy(){varUrl=document.getElementById("Id");Url.select();//errordocument.execCommand("Copy");//browsercopy}如上。我正在尝试制作一个在浏览器中复制文本的功能。但是出现了标题错误在typescript中。我认为select()是有效的(link),因为我在演示中使用它时可以正确复制。我的ts版本是2.8.1 最佳答案 您需要添加一个typeassertion:varUrl=document.getElementBy

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}

javascript - 错误 : Cannot find module 'jade~'

我是Nodejs的新手。我使用CompoundJs创建了一个crud操作。应用程序运行良好,直到我尝试提醒一个值,之后我收到错误500Error:Cannotfindmodule'jade~'atFunction.Module._resolveFilename(module.js:338:15)atFunction.Module._load(module.js:280:25)atModule.require(module.js:362:17)atrequire(module.js:378:17)如何解决这个问题我的索引#tabsullia(href='#tabs-1')NewLeave

javascript - 为什么在使用@angular/redux-store 中的@select 时,Angular 守卫的行为会有所不同

我有一个使用两个守卫的Angular设置。canLoad和canActivate两者都通过@select从@angular-redux/store获取相同的可观察值问题:为什么canActivate与@select返回的可观察对象一起工作,而canLoad会中断所有路由然后呢?这两个守卫有什么区别?相关Angular问题:https://github.com/angular/angular/issues/18991auth.guard.ts@Injectable()exportclassAuthGuardimplementsCanLoad,CanActivate{@select()re

javascript - select2 - 将获取远程数据与多个选择和预数据相结合

您好,我正在寻找使用select2的方法,到目前为止我所看到的看起来不错。不过,我正在尝试做一件事。我希望通过对json文件的ajax调用来获取我的数据-他们的网站上有一个关于如何执行此操作的示例,但我正在尝试有一个预填充列表。我的意思是,例如,当用户点击在此链接上搜索电影时http://ivaynberg.github.io/select2/#infinite列出了json文件中的前10部电影,因此有一些预先选择。谁能指出我正确的选择到目前为止,这是我的代码functionmovieFormatResult(movie){varmarkup="";if(movie.posters!=

javascript - Angular 翻译 : Child Module translatePartialLoader urlTemplate overrides the Parent Module translatePartialLoader urlTemplate

我必须使用多个具有不同urlTemnplate的translatePartialLoader。我正在使用angular-translate-loader-pluggable。看起来子模块urltemplate覆盖了父模块urltemplate父模块配置$translateProvider.useLoader('$translatePartialLoader',{urlTemplate:__env.hostUrl+'/*****/****/localization/resource_bundle?bundle_name={part}&locale={lang}'});$translate

javascript - 覆盖 Enter 键的 SELECT 行为

处理一个或多或少像电子表格一样操作的HTML控件-具有可编辑数据单元格矩阵。WhenitcomestocellsderivedfromaSELECTI'mhavinganissuegettingthecorrectbehaviorwhenthattypeofcellisselectedforedit:如果我使用其默认格式(大小=0)呈现Select,则用户会得到Select的Enter-key处理的不当行为:第一次输入=>激活对单元格的编辑(显示选择控件)第二次输入=>展开选择以显示选项用户使用向上/向下键进行选择3rdEnter=>关闭列表。(问题:此Enter对“keydown”事