Ionic with requirejs


#1

Do you have any idea about using requirejs and ionic ?


#2

Hey @tseegii_it. I’m not quite sure how that would work, but it should be possible. The only thing is we ship ionic.js as a monolithic library, mainly because we weren’t concerned with module loading since all assets should be local when you deploy to a native wrapper.

Perhaps take a look at this angular require seed project: https://github.com/tnajdek/angular-requirejs-seed

Hope that helps!


#3

You didn’t think people would want to preload their local modules without including dozens of JS files in index.html?
That’s the biggest issue with all fancy frameworks nowadays. They are built for hello world applications … Pretty disappointed. You encourage spaghetti code.


#4

Well you concatinate and minimize your main javascript file, and all the bower libraries can be added to index.html automatically using gulp wiredep.

Angular has good dependency injection, so I don’t see why you would need require.js here.


#5

Might not need it, certainly want it, though. At least for testing purposes, you may just want to pull in a definition – us architecturally-minded people can think of a few good reasons: Lazy-Loading and EDA to name a couple – but I’m new to Ionic so I’ll need to checkout the conventional architecture.