最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - AngularJS: Dependency Management - Stack Overflow

programmeradmin5浏览0评论

We are currently planning a website which exists out of different AngularJS apps that will make use of mon services. Services will be implemented in seperate files; to minimize the filesize of the apps we want to include/concatenate only those service-files that are used in the corresponding app - so we are looking for the best practise in dependency management.

is there something like requireJS in angular or what would you suggest to handle the includes? thanks in advance .)

We are currently planning a website which exists out of different AngularJS apps that will make use of mon services. Services will be implemented in seperate files; to minimize the filesize of the apps we want to include/concatenate only those service-files that are used in the corresponding app - so we are looking for the best practise in dependency management.

is there something like requireJS in angular or what would you suggest to handle the includes? thanks in advance .)

Share Improve this question asked Aug 25, 2013 at 15:55 MrMuhMrMuh 4192 gold badges5 silver badges14 bronze badges 2
  • 2 Me personally? I'd just use Grunt and call it a day. – Joseph Silber Commented Aug 25, 2013 at 15:57
  • Grunt is not a dependency manager. – mwilcox Commented Apr 25, 2015 at 18:58
Add a ment  | 

3 Answers 3

Reset to default 3

I suggest to use the same organization as ng-boilerplate: https://github./joshdmiller/ng-boilerplate

I use an organization close to ng-boilerplat for one project and it allowed us to be modular in our dependency management.

For me, the only build/deployment system that works like a charm for most web apps that have extremely js putation is yeoman.
This quote should describe what it is/does:

Yeoman 1.0 is more than just a tool. It's a workflow; a collection of tools and best practices working in harmony to make developing for the web even better.

So basically, it is a npm that installs all the boilerplate files, dependencies and configures your whole app with the help of generators. It uses bower and gruntalso takes care of the hard part of configuring grunt that is in charge of building/deploying your app.
I highly remend yeoman as a modern and efficient workflow.

I personally haven't looked at the ng-boilerplate as @Julio mentioned above, but you could easily manage to configure and use RequireJS with angular of you want to. I've done it and it works like a charm.

发布评论

评论列表(0)

  1. 暂无评论