requirejs

How to set up JASMINE using MAVEN-PLUGIN?

让人想犯罪 __ 提交于 2019-12-10 20:28:37
问题 I have a folder structure like -root -pom.xml -service -web -pom.xml -src -main -test -java -javascript -lib -specRunner.js -runner.html -spec -model -view -collection I have written JASMINE test cases in the "spec" folder containing "model","views","collections". I'm able to see my test results in runner.html. Now i'm trying to integrate with MAVEN build. SO followed steps given in http://searls.github.io/jasmine-maven-plugin But i'm getting build failure when doing mvn clean install and

Loading Google Web Fonts using require.js font plugin

天涯浪子 提交于 2019-12-10 20:17:52
问题 I'm using https://github.com/millermedeiros/requirejs-plugins to load the google font and it works fine for the basic font. require.config({ paths : { font: 'lib/require/font', } }); define([ 'font!google,families:[Roboto]' ], function(){ //all dependencies are loaded } ); the above is fine, but if I try Roboto:400,500,700,900 , it won't work to load the bolder fonts. 回答1: define(['backbone','app-init','font!google,families:[Yanone Kaffeesatz:700]'], function(Backbone, AppInit,Font) { AppInit

Sinon's fake server is not responding

烂漫一生 提交于 2019-12-10 20:14:13
问题 There are a number of other questions asking about Sinon failing to respond, but they all seem to resolve with something mundane, like invalid response data or a toggled configuration option. My situation is as follows: In the main application (at /js/app/ ) requireJS is used to load website application modules. For testing (at /js/test ) requireJS is also used to load the same modules, but adds Mocha, Chai, and Sinon. This is the bootstrap of the test application: define( "testRunner", [

How do I format the dependency names for RequireJS in MVC when using IIS?

六眼飞鱼酱① 提交于 2019-12-10 19:42:57
问题 I followed a now deleted blog (see all my code below for what I did) to create a basic RequireJS structure in MVC. While in IIS Express everything works as expected. When in IIS the core module is not found. The only difference between the two (IIS and IIS Express) is that the Map Paths shows wwwroot for IIS and the actual file path where I am developing for IIS Express. Here is the code I am referring to that builds the require script. if (File.Exists(helper.ViewContext.HttpContext.Server

Reference bundles on requirejs

南笙酒味 提交于 2019-12-10 19:24:47
问题 I have an old web application that already uses bundling and minification of ASP.Net MVC. Now I'm starting to use requirejs and I have a problem! How can I reference bundle files from requirejs? I know that there is another similar question, but it does not answer to my question! How to reference the bundled js files (asp.net mvc4) in Require.js? 回答1: I'm hoping that I understand your question correctly. If your bundle contains requireJS modules and you're loading it on the page, you can

Backbone.js and Require.js: Mismatched anonymous define() module: function (_, Backbone) {

不打扰是莪最后的温柔 提交于 2019-12-10 19:09:45
问题 I am new to using require.js and have the following app.js file as part of my backbone app: require.config({ baseUrl: "/js/", paths: { jquery: 'libs/jquery-2.1.0', underscore: 'libs/underscore-min', backbone: 'libs/backbone-min' }, shim: { underscore: { exports: "_" }, backbone: { deps: ['underscore', 'jquery'], exports: 'Backbone' }, } }); In a tag in my index.html file, I have placed the following: define(['underscore', 'backbone'], function (_, Backbone) { However, I am getting the

VS + Cordova + WP8 = requirejs load timeout for modules

笑着哭i 提交于 2019-12-10 19:08:47
问题 I am building a windows phone mobile game using Visual Studio 2015 + Cordova. When trying to debug on device I get this error: Unhandled exception at line 8, column 137 in ms-appx-web://net.boardgamesonline.drawit/www/js/libs/require.js 0x800a139e - JavaScript runtime error: Load timeout for modules: sounds,libs/signals.min,config,components/share.... My VS runs on Windows 10 and has everything updated (cordova, sdks, tools..) The same project was built for Android and iOS using Intel XDK and

Loading Angular from CDN via RequireJS is not injected

荒凉一梦 提交于 2019-12-10 18:43:30
问题 In my project I want to use RequireJS and bootstrap my app as follows: requirejs.config({ baseUrl: 'scripts/vendor', paths: { jquery: [ 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min', 'jquery' ], angular: [ 'http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min', 'angular' ], app: '../app' } }); require(['require', 'jquery', 'angular', 'app'], function(require, $, angular, app) { console.log(require); console.log($); console.log(angular); console.log(app); }); On

Exclude all starting with x in requirejs module

大城市里の小女人 提交于 2019-12-10 18:32:42
问题 I am " compiling " some files into one requirejs module. I have a configuration like this: paths: lib : "../lib" angular: "../lib/angular" modules: [ { name : 'myApp' exclude: ["lib/jquery", "lib/angular"] } ] (syntax is cofeescript) I want to exclude all files located under "lib" (e.g. starting with lib/ ) in " myApp " module. I now I can write them one another one like this: ["lib/jquery", "lib/angular"] But more libs and modules will be added in the future so some kind of automatization

RequireJS text plugin and variable concatenated string

扶醉桌前 提交于 2019-12-10 18:27:14
问题 I'm using RequireJS text plugin to load some html templates. When I passing a string literal to the require function it works fine. var templateHTML = require('text!templates/template_name.html'); But when I using variable concatenated string var templateName = 'template_name'; var templateHTML = require('text!templates/'+templateName+'.html'); It throws following error: Uncaught Error: Module name "text!templates/template_name.html" has not been loaded yet for context: _ Any ideas for this