Here is the directive
module.exports = ()=>{
return {
restrict: 'E',
templateUrl: "/components/event/event.html",
scope: {index: '@'},
controller: "eventCtrl"
};
};
The code for controller
module.exports = ($scope)=>{
console.log($scope.index);
$scope.loadDetails = ()=>{
console.log("hello there");
}
};
and for template
.event
h3(ng-bind="index.title")
p(ng-bind="index.description")
.price(ng-show="index.is_paid") {{cost}} $
a.button-primary(ng-click="loadDetails()") Details
The problem is the variables are not being rendered in the template. I tested if it is being passed correctly using console.log and i am getting proper response. Also the function loadDetails() is working properly leading me to believe that there is not problem with setting up the controller. Where exactly am i going wrong ?