I am trying to call a function in a directive from a template of other directive
discount.directive
angular.module('main').directive('dtDiscount', function(discountFactory, languageFactory, $ionicPopup) {
return {
scope: {
operators: '=operators',
toggle: '=toggle',
},
templateUrl: 'templates/components/discount.html',
link: function ($scope, $element, $attrs) {
$scope.setDiscount = function(value, fromDrag){
....
}
}
....
discount html
<div class="drag-input-horizontial" dt-drag-horizontial ng-model="s3">
drag.horizontial.directive
angular.module('main').directive('dtDragHorizontial', function($window,
$ionicScrollDelegate) {
return {
require: 'ngModel',
scope: {
},
templateUrl: 'templates/components/horizontial-drag-input.html',
link: function($scope, $element, $attrs, $ctrl) {
}
horizontial.drag-input.html
I want to call setDiscount function in discount.directive.Does anyone know how I can do this?
<ds>
<da ng-click="setDiscount(3,true)">someText</da>
</ds>