JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="main">
<div ng-controller="MainController as mainController">
{{mainController.name}}
</div>
</div>
JavaScript
(function (ng) {
var homeModule = ng.module('home', []);
homeModule.service("HomeService", [function () {
var homeService = this;
homeService.getName = function () {
return "Home Service";
}
}]);
})(angular);
(function (ng) {
var productModule = ng.module('product', []);
productModule.service("ProductService", ["HomeService", function (HomeService) {
var productService = this;
productService.getName = function () {
return "Product Service - " + HomeService.getName();
};
}]);
})(angular);
(function (ng) {
var mainModule = ng.module('main', ['home', 'product']);
mainModule.controller("MainController", ['ProductService', function (ProductService) {
var mainController = this;
mainController.name = ProductService.getName();
}]);
})(angular);