requirejs

EmberJS - RequireJS - How to connect a view/template to an outlet of a child view

笑着哭i 提交于 2019-12-23 02:38:55
问题 Again a question due to EmberJS evolving quite fast :) [EDIT] I am using EmberJS from github. This is the version I am using https://github.com/emberjs/ember.js/tree/c87ad9fc13f7883e7b898c9fb9b1630cb2fc9bf1 [/EDIT] This question is a follow up of EmberJS - Manually bind controller to view But you don't need to read it to understand the following question. I have an EmberJS application and I am using requireJS to load my controllers and views for the section of the application the router is

How can you load multiple JQuery plugins?

▼魔方 西西 提交于 2019-12-23 02:26:28
问题 How can you load multiple JQuery plugins that use the $ to access methods? My configuration file ( config.js ) is as follows: var require = { paths: { "jquery": "lib/jquery", "jqueryui": "lib/jquery-ui", "semanticui": "lib/semantic", }, shim: { "jqueryui": { exports: "$", deps:['jquery'] }, "semanticui": { exports: "$", deps: ['jquery'] } }}; My application file ( load.js ) is defined as follows: define(['jqueryui', 'semanticui'], function ($) { console.log($); }) I found that the $ was

How can you load multiple JQuery plugins?

余生颓废 提交于 2019-12-23 02:26:09
问题 How can you load multiple JQuery plugins that use the $ to access methods? My configuration file ( config.js ) is as follows: var require = { paths: { "jquery": "lib/jquery", "jqueryui": "lib/jquery-ui", "semanticui": "lib/semantic", }, shim: { "jqueryui": { exports: "$", deps:['jquery'] }, "semanticui": { exports: "$", deps: ['jquery'] } }}; My application file ( load.js ) is defined as follows: define(['jqueryui', 'semanticui'], function ($) { console.log($); }) I found that the $ was

How do I integrate Foundation 3 in an AMD manner

假如想象 提交于 2019-12-23 01:25:17
问题 EDIT 4 There's a module defined in (from Foundation 3 package) app.js : (function($, window, undefined) { 'use strict'; var $doc = $(document), Modernizr = window.Modernizr; $(document).ready(function() { $.fn.foundationAlerts ? $doc.foundationAlerts() : null; // ... $.fn.foundationClearing ? $doc.foundationClearing() : null; $('input, textarea').placeholder(); }); // touch support detction is omitted })(jQuery, this); I tried to interpret it to the next form: BOOTSTRAP.JS require.config({

Module granularity strategies

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 20:45:15
问题 I'm building a KnockoutJS web app using RequireJS to modularize it. I'm trying to decide between a couple of strategies to break things into modules. Flat approach : One approach features a flatter directory structure and larger modules: /webapp |-/scripts |-/templates | |-car_edit.html | |-car-view.html | |-person_edit.html | |-person_view.html |-main.js |-person.js |-car.js As an example, the person module (in person.js) is implemented something like this: define(['jquery', 'knockout', ...]

Use requirejs to load a file with several classes inside (grunt-concat)

情到浓时终转凉″ 提交于 2019-12-22 18:15:10
问题 I have a little problem with grunt concat and requirejs (and typescript). The problem is simple, when I generated one file per class and I load each file seperately, I don't have problem. (But it's slower for the browser) Example: A.js Message.js ValidatorMessage.js (extends Message and has a dependency) loader.ts: require.config({ paths: { 'A': '../generated/shared/A.min', 'Message': '../generated/shared/Message.min', 'ValidatorMessage': '../generated/shared/ValidatorMessage.min', }//more

How to load ace editor theme from CDN with requirejs?

断了今生、忘了曾经 提交于 2019-12-22 11:28:12
问题 I am trying to load an ace theme from a CDN with requirejs. Here is a plunkr which illustrates my problem. The theme can not be found in the following case: requirejs.config({ paths: { ace: ['//cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/'] } }) $('h1').text("loading ace..."); requirejs([ 'ace/ace'], function(ace) { $('h1').text("ace loaded.") console.log(ace) editor = ace.edit('editor') editor.setTheme("ace/theme/monokai") return }) Note: I asked this question to load ace editor with requirejs

How to define controller, router and app in the right order using requireJs

大城市里の小女人 提交于 2019-12-22 11:22:29
问题 I am writing a small app ( initApp.js , initApp.routinj.js , initApp.controller.js ) which modules needs to be loaded using requires. Here's my code (*). Using console.log in each modules I see that the sequence how the modules are loaded is the following: 1) initController 2) initRouting 3) initApp Is this the right order? Now another question. In initApp.controller.js I need to access the function like initHeader and initSidebar (defined in initApp.js ). But as you can see from my code (

RequireJS: How to define a constructor?

大兔子大兔子 提交于 2019-12-22 10:48:20
问题 I want to create constructors according to the AMD specification. I found this answer and tried to follow it. Here's what I ended up with: main.js requirejs.config({ paths: { 'jquery': 'vendor/jquery-1.9.1.min', 'lodash': 'vendor/lodash-1.3.1.min', 'knockout': 'vendor/knockout-2.2.1.min', 'bootstrap': 'vendor/bootstrap-2.3.2.min' } }); requirejs( ['jquery', 'lodash', 'knockout', 'controller/categories'], function main($,_,ko, CategoriesCtrl) { var categories = new CategoriesCtrl(); } );

Has Phonegap integrate socket.io in version 3.5.0-0.20.10?

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:56:48
问题 Since I've update my PhoneGap to version 3.5.0-0.20.10 I get problems in my project. When I'm running the PhoneGap service, then I see in the cli; [phonegap] 200 /socket.io/?EIO=2&transport=polling&t=....... But I don't use socket.io . Using the Chrome developer tools I see that in my project is a socket.io folder with a socket.io.js . So I think PhoneGap import it by itself. And my RequireJS have now a problem: Uncaught ReferenceError: io is not defined I tried to remove RequireJS, then it