草庐IT

SOURCE_SYSTEM

全部标签

javascript - JS文件中的System.register是什么意思?

在Angular2中使用指令时,JS文件中的System.register是什么意思。 最佳答案 我认为这个问题并不特定于angular2中的指令,它是关于ES6、TypeScript和其他使用SystemJS的现代编译器的一般问题。简短的回答-它是由System.js创建的包装器,用于隔离代码并注入(inject)外部依赖项。这段代码:import{pasq}from'./dep';vars='local';exportfunctionfunc(){returnq;}exportclassC{}将生成:System.registe

javascript - Select2.js v4.0 : how set the default selected value with a local array data source?

通过使用select2.jsv4插件,当我使用本地数组数据作为源时,如何设置默认选择值?以这段代码为例vardata_names=[{id:0,text:"Henri",},{id:1,text:"John",},{id:2,text:"Victor",},{id:3,text:"Marie",}];$('select').select2({data:data_names,});如何设置id3为默认选中值? 最佳答案 $('.select').select2({data:data_names,}).select2("val",3);

javascript - 文件 API : Directories and System -- discontinued. .. 这是什么意思?

我知道了,截至2014年4月24日http://dev.w3.org/2009/dap/file-system/pub/FileSystem/在FileAPI上的工作已经停止。这就提出了两个问题:1.createObjectURL()读取本地文件有什么影响吗?(我想不会,因为这似乎被广泛实现)2.假设有人想将Web应用程序(如绘图程序)的输出本地保存到文件中。如何做到这一点以及4月24日的声明是否对实现这一目标的能力有影响。 最佳答案 我认为您可能误读了该声明。FileApi并没有停产,只是一个文件被打折了。看这里:http://d

javascript - 无法动态转译 ES 模块 System.config({ transpile : 'transpile-module' })

这是我的tsconfig.js{"compilerOptions":{"experimentalDecorators":true,"emitDecoratorMetadata":true,"moduleResolution":"node","target":"es5","module":"system","noImplicitAny":false,"outDir":"built","rootDir":".","sourceMap":false},"exclude":["node_modules"]我正在使用tsc命令将我的“hello-angular.ts”转译为“hello-angu

javascript - ES6 : No source code for webpack "cheap-module-eval-source-map" and "cheap-module-source-map" only ** WEBPACK FOOTER **

它曾经有效。现在,当我添加一个断点时:saveSnippet:(title,imageUrl,role)=>{debugger;...chrome(53)中的结果是:我尝试使用它并将配置更改为'cheap-module-source-map'和'eval-source-map'和'source-map'。现在只有'eval-source-map'和'source-map'可以工作。webpack.config.js(Webpack1.13.2):varpath=require('path')varwebpack=require('webpack')varCompressionPlugi

javascript - 如何在 DOM 中显示 source map 的 JS 错误

我正在尝试调试使用create-react-app为Googlebot创建的应用。TL:DR:我需要将我的错误添加到DOM中,以便它在Google机器人渲染中可见。问题是我如何获得React在开发中显示的准确(通过源映射)文件/行/列号以显示在DOM节点中。关于Googledocumentationfordebuggingrendering,他们提供了一个使用全局window.addEventlistener('error')的片段,将错误添加到DOM,以便它在Googlebot生成的渲染屏幕截图中可见。但是,当我在开发中尝试这样做时,我将其作为堆栈跟踪的第一行:在Home.rende

javascript - 华丽的弹出窗口 : source title from span

我想从anchor标记内的隐藏标题字段中获取我的Magnific图片的标题-而不是从标题中获取。这是因为我的标题包含标记。HTMLThisisacaptionwithalinkinitJS//initialisethemagnificlightbox$('.js-lightbox').each(function(){$(this).magnificPopup({delegate:'a',type:'image',tLoading:'Loadingimage#%curr%...',gallery:{enabled:true,navigateByImgClick:true,preload:

javascript - 如何在 Chrome 打包应用程序的 list 中使用 "system_indicator"?

我正在尝试创建一个在系统菜单栏中带有图标的Chrome包应用程序,如下所述:https://docs.google.com/document/d/1QhhfR33Y28Yqnnoa_Sl3fnZK_mKtwt4dZe6kNyJ_MjU/edit,GoogleHangout应用程序可以实现此功能(这不是完全相同的行为),但我找不到任何好的文档来执行相同的操作。在GooglePackagedApp的manifest页面中,我们可以看到“system_indicator”字段。是我要找的吗?当我尝试将此字段设置为图标的url时,Chrome返回此错误:'system_indicator're

javascript - 未捕获的类型错误 : System. 导入不是函数

这段代码应该显示一个包含HelloWorld的div,但我却收到错误UncaughtTypeError:System.importisnotafunction。我正在观看ng-book2的入门教程视频,其中在index.html中包含以下代码:Angular2System.import('js/app');和app.ts:///import{Component,View,bootstrap}from'angular2/angular2';//Annotationsection@Component({selector:'hello-world'})@View({template:'Hel

javascript - 崇高文本 3 : Build System - node. js。 NPM 模块未执行

我正在尝试在sublimetext3构建系统中执行node-dev。node-dev在我的路径中:然而当我运行这个构建脚本时:{"cmd":["node-dev","$file"],"selector":"*.js"}我收到此错误,这也表明npm在我的路径中。然而,当我使用node而不是node-dev运行相同的构建脚本时,它执行得很好。我还尝试包含指向node-devbin文件夹的“路径”变量,这根本没有帮助。如有任何帮助,我们将不胜感激。谢谢。 最佳答案 以下在Windows上的SublimeText3中为我工作工具->构建系统