Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9259149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:35:08+00:00 2026-06-18T12:35:08+00:00

In my project I want to use RequireJS and bootstrap my app as follows:

  • 0

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 my index.html only RequireJS is loaded via script tag, where the RequireJS loads the above code.
What works:
– in my Network monitor I can see that RequireJS, jQuery, Angular and app are loaded
– The console.log messages print correct for require, jQuery and app

The angular object is somehow undefined. But if I don’t load it from CDN and use my local load, it works! The local file is a RequireJS wrapper that looks like this:

define(['/components/angular/angular.min.js'], function () {
    return angular;
});

How do I get this work with Angular’S CDN? Or does this depend on support from Angular?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:35:09+00:00Added an answer on June 18, 2026 at 12:35 pm

    First, you are confusing “paths” with “shim”

    Path is good, don’t go for “shim” behavior. But, you need to make your “paths” proper:

    paths: {
        jquery: 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min',
        // NOTE: angular is "plain JS" file
        angular: 'http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min',
        app: '../app'
    }
    

    Then, you need to let go of the need to have something returned to you… Just “use the force, Luke” 🙂 and expect the right globals to be there when you need them:

    require(['jquery', 'app', 'angular'], function($, app, thisValueDoesNotMatter) {
        // you don't need to wrap "require" Just use global
        console.log(require);
        console.log($);
        console.log(app);
    
        // note, angular is loaded as "plain JavaScript" - not an AMD module.
        // it's ok. It returns "undefined" but we just don't care about its return value
        // just use global version of angular, which will be loaded by this time.
        // because you mentioned it in your dependencies list.
        console.log(window.angular);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
I work on a project and want to use an ORM. What should I
I am using django 1.1 beta release. In my project I want to use
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I'm working on a new project where I want to use Phil Haack Areas
I want to use MAF in my project because I need a robust add-in
I want to use cookie in my project. But now i m using session.
I want to use Lucene in my project. When I simply copy the .jar
I want to use dynamic ExpandoObjects for a project I'm working on, but it
I want to use DDD in a new project and model my classes first,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.