Skip to content

Instantly share code, notes, and snippets.

@tygern
Last active September 28, 2015 19:40
Show Gist options
  • Select an option

  • Save tygern/d319b0a8f96c4e0d2819 to your computer and use it in GitHub Desktop.

Select an option

Save tygern/d319b0a8f96c4e0d2819 to your computer and use it in GitHub Desktop.
Angular transitive dependency
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="myApp">
<div ng-controller="welcomeController">
<h1>{{message}}</h1>
</div>
</body>
</html>
https://jsbin.com/duriworiqo/edit?html,js,output
angular.module('depB', []);
angular.module('depA', ['depB']);
angular.module('myApp', ['depA']);
angular.module('depB').value('someValue', 'Transitive');
angular.module('myApp')
.controller('welcomeController',
function ($scope, someValue) {
$scope.message = someValue;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment