Skip to content Skip to sidebar Skip to footer

Angularjs Controller Function Not Recognized

I have an AngularJS project with the structure shown in the first picture. I use custom tags defined as angularJS components. My main layout uses the custom tag by displaying i

Solution 1:

Here you put ctrl instead of $ctrl

$ctrl.getSumaCercetare = function () {
            return (ctrl.getSumaCercetareSolicitata() + $ctrl.getSumaCercetareAprobata());
        };

but I don't think that this can cause your issue

Solution 2:

Here's my shot in the dark: instead of '$ctrl = this;' at the very minimum you need to say 'var $ctrl = this;'.

And really, you shouldn't use '$ctrl' inside your controller (that's just for use in the the template); you should use something like 'var vm = this;' or just use 'this'.

Post a Comment for "Angularjs Controller Function Not Recognized"