Using Convention Over Configuration to Load Directives

18 views
Skip to first unread message

Joe Sack

unread,
Feb 27, 2015, 3:05:26 PM2/27/15
to ang...@googlegroups.com, David Strelitz
Our team is engaged in rapid development using AngularJS. We manage our directives by adding them to our application's module in a centralized file (ordersapp.js). Every time we add a directive, we have to wait for a review or open a new CitC in order to create another new directive because ordersapp.js is included in the CL for the first directive. Since our directive declarations are repetitive and predictable, I thought we might be able to replace them with code that would automagically detect our directives and load them with our app. I've created a proof of concept in the following CL:

https://goto.google.com/dynamicdirectiveloading

The same technique could be applied to services and filters, and might be applicable to other AngularJS application across the company. That being said, I'm relatively new to AngularJS. Does this look like a good solution, or will it cause more headaches than it's worth?

Thanks,

Joe Sack
Reply all
Reply to author
Forward
0 new messages