Skip to content

Instantly share code, notes, and snippets.

@aeisenberg
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aeisenberg/2ef4c15adf47f107c6ff to your computer and use it in GitHub Desktop.
Save aeisenberg/2ef4c15adf47f107c6ff to your computer and use it in GitHub Desktop.
Angular apps are not modular
<!DOCTYPE html>
<html ng-app="parent">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js"
type="text/javascript"></script>
<script type="text/javascript">
angular.module('sub1', [])
.run(function(sub2Value) {
console.log(sub2Value);
});
angular.module('sub2', []).value('sub2Value', 'I should be an error!!!');
angular.module('parent', ['sub1', 'sub2']);
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment