Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialac10
12,799 PointsA new file for every custom directive?
Do you have to create a new JS file for every custom directive? It wasn't clear in the video.
Thanks in advance!
1 Answer
M Gavin
17,906 PointsPartitioning code into multiple files is a style choice. You don't have to, but if your code is long, then it might be a good idea to create a new file to make it easier to maintain. Too many files vs long code in a single file... it's a decision you would have to make.
Personally, I would prefer a new file (except if it's a one-liner). It's just easier to read in a separate file than inside quotes.
ac10
12,799 Pointsac10
12,799 PointsOk gotcha, thanks!