Skip to content

Instantly share code, notes, and snippets.

@leog
Created June 1, 2015 02:46
Show Gist options
  • Save leog/40fc4bb22a83b5f62e26 to your computer and use it in GitHub Desktop.
Save leog/40fc4bb22a83b5f62e26 to your computer and use it in GitHub Desktop.
Very simple RequireJS modules defining AngularJS modules and injecting both as dependencies
define([‘angular’], function(angular) {
angular
.module(‘first’, [])
.filter(‘greet’, function() {
return function(name) {
return ‘Hello, ‘ + name + ‘!’;
}
});
});
define([‘angular’, ‘firstModule’], function(angular) {
angular
.module(‘second’, [‘first’])
.filter(‘goodbye’, function() {
return function(name) {
return ‘Good bye, ‘ + name + ‘!’;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment