Argument 'Ctrl' is not a function, got undefined


Good afternoon Community, I come with this error.

In my File iedu-angular.js I have the following:

angular.module('facturasiModulo', [])
.controller('IEDUCtrl', ['$scope', IEDUCtrl]);

function IEDUCtrl($scope){
  console.log("Aqui aun vivo");
  $scope.nivelEducativo = ["Prescolar", "Primaria", "Secundaria","Profesional Tecnico", "Bachillerato o su Equivalente"];
  $scope.currentNivelEducativo = "Prescolar";
  console.log("Termina tu JavaScrpit");

And I send it to call my iedu.html.haml in this way:


When I load the page I get the following error in the JavaScript console:


Argument 'IEDUCtrl' is not a function, got undefined

I hope you can help me.


asked by IngErick 09.02.2016 в 00:05

2 answers


Well folks, apparently my problem was solved in the following way, I had to add the following line of code:

//= require complementos/iedu_angular

In the applications.js file of my project.

Thank you all for your help and recommendations.

answered by 10.02.2016 / 23:53

Make sure you have your HAML

%html{ ng:{ app:"miApplicacion",controller: "IEDUCtrl" } }
answered by 09.02.2016 в 00:30