Let's say we have a few dozen "general purpose" utilities in the form of angular directives, like this one for ignoring typed characters other than 0-9.
How do we set up a file containing those directives so that it would be easy to include them in any angular module, and how do we include them?
Do we just create a module Foo
to hold these directives
var FOO = angular.module('Foo', []);
FOO.directive('stripExcessWhiteSpace', function() {
return {
<snip>
}
});
and then include that module in our current app? Does the name of that file have to be Foo.js
and does the file have to be in the same folder the file for our current app is found in?
var app = angular.Module('Customers', ['Foo']);
or is there more to it?