0

I am new to angular and I'm trying to load/create an angular module using requirejs. For some reason the config block never gets called. I don't think requirejs is to blame here - it's only for the sake of completeness.

define(['./IdeaListCtrl'], function (IdeaListCtrl) {

    var moduleName = 'clap.Idea';

    console.log("Loading " + moduleName); // Printed
    angular.module(moduleName, []).config(function () {
        console.log("Config block accessed"); // NOT PRINTED
    });


   console.log("Loaded " + moduleName); // Printed

   return moduleName;

});

1 Answer 1

1

Angular essentially lazy-loads its components so you need to bootstrap the module to the page or reference it elsewhere before it will run the config block.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.