Comments (4)
That'll be RequireJS - a view source will show just the one script in play, whilst requirejs is actually inserting those scripts in to the DOM at run-time. If you build your app and run from dist, you should see the one, compressed build JS being used instead.
As both page1 and page2 are essentially views in your SPA, you;ll get them both downloaded when running from the app folder.
Sorry if that didn't make sense - it's late here. If you would like me to clarify further, I'd be happy to tomorrow.
from generator-angular-require.
Thanks @aaronallport , I have a couple more questions if you don't mind...
- If the system then loads each view, then what is the "lazy loading" part of this? What is loading as-needed?
- Running from dist: I've tried to open /dist/index.html, but the page is still pointing to the bower_components require js in the folder above:
<script src="bower_components/requirejs/require.js" data-main="scripts/main"></script>
- Is there something else I need to do to run from dist?
- I tried pointing that line to scripts/main.js, but that just gave an error:
Uncaught ReferenceError: define is not defined main.js:6
thanks,
Scott
from generator-angular-require.
Hi Scott, take a look at the latest version - you'll hopefully notice that point 2 is fixed. As for point 1, only requirejs is in the bower_components directory under dist - this is so that the script tag to load requirejs in the index.html file doesn't need to be updated when building.
Cheers,
Aaron
from generator-angular-require.
Thank you Aaron!
Due to expanding requirements for our internal Angular apps, I've had to move forward with building our own system. So, I've been putting all my efforts into this:
scottnath/atlas
Thank you for fixing that, it will help me with some personal projects!
-Scott
from generator-angular-require.
Related Issues (20)
- Added generator-angular-require to comparison of starters HOT 2
- On newly generated, package.json has "grunt-filerev": "^0.2.2", version doesn't exist HOT 6
- Lazy loading controllers HOT 2
- when I run 'grunt build', it's has a error HOT 2
- JQuery... How to add in the require.config so can load before angular? HOT 2
- Path to long in MSBUILD Task UTF-8-Validate HOT 1
- Grunt and Requierejs? HOT 2
- Support namespace support for angular module HOT 3
- RequireJS can't find angularjs and the other angular modules (ngRoute, ngResource) HOT 6
- angular-ui-router addition HOT 2
- Avoid combining script to single js file HOT 1
- Fix tests HOT 1
- Getting dependency errors of grunt & karma HOT 1
- Angular Modules' quotes being displayed as html entities
- Add typescript version of generator files HOT 1
- How to structuring a project with mulitple app ?
- use the generator,show "Uncaught ReferenceError: ngCookies is not defined" HOT 2
- installing on git bash HOT 1
- yo angular-require [project name] installation error HOT 1
- came out without warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-angular-require.