-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling controllers and services in subfolders #30
Comments
Hi @SoldierCorp requireAll(require.context('./services', true, /\.js$/));
function requireAll(require) {
require.keys().forEach(require);
} What the above code does is it recursively looks through the directory "services" for all files ending with ".js" and require() it. |
EDIT: I fixed the error I posted originally but I am still have problems. I tried following the example by stefek99, but some information must be missing. I created a folder under app called "spanText" and added a js file. I then referenced it in app.js. My js file is a copy of the app.js file in the git repository. I renamed app to spanText and the directive to . I copied the html template etc.... However, my custom directive is never getting rendered. Its an empty tag in the dom. What is missing? |
here is a bigger project that I just needed to upgrade to unit tests and used the great config from this repo. Thanks! |
@surfjedi maybe you can help me fill in the blanks. when I run the code from the github repo you posted, all I see in browser is a directory listing of the generated js files. I do not see any of the "angular stuff" kicking in at all, definitely not seeing what is designed in index.html |
I fixed a missing dep in package.json earlier today. Sorry - pull again. Then make sure you "npm install" then "npm run dev". there is minor bug in lazy loaded states due to code splitting im working on, and I'm adding tests FYI. Its a work in progress. But the folder structure you are looking is there and working |
Hi!
In order to use this kind of app structure for angular
app.js
--- controllers
------ controller.js
--- services
------ service.js
The webpack configuration you have will work? Or if not, is there a way you can help me to do that?
Kind regards.
The text was updated successfully, but these errors were encountered: