Argument 'Ctrl' is not a function, got undefined

0

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:

%div#iedu(ng-controller="IEDUCtrl")

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.

Greetings

    
asked by IngErick 09.02.2016 в 00:05
source

2 answers

0

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
source
1

Make sure you have your HAML

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