=====Зависимости=====
в данном случае создается полностью новый модуль, который передается в другой модуль как зависимость
**directive.js**
angular.module("additionalModule", [])
.directive("triButton", function () {
return {
scope: { counter: "=counter" },
link: function (scope, element, attrs) {
element.on("click", function (event) {
console.log("Button click: " + event.target.innerText);
scope.$apply(function () {
scope.counter++;;
});
});
}
}
});
**index.html**
Services and modules