I've read lot of question with same text but none helped me, so I ask a new one.
I have a ng-app, ng-controller.
<div ng-app='mainApp'>
<div ng-init='period=".$_REQUEST['period']."' ng-controller='debtController'>
Then, some lines bellow, define them.
<script type='text/javascript'>
var app = angular.module('mainApp', []);
app.controller('debtController', function(){
openDebt = function(period){
console.log(period);
}
});
</script>
And last but not least, a ng-click that calls the function defined.
<a href="#" ng-click="openDebt('{{period}}')" />+</a>
So, if I click the '+' with the ng-click, nothing happens. But if I check the HTML there, and copy the text inside the ng-click, and then paste it in the console, it works. Why the function is not being called?
Anyone got any ideas?