Angularjs / Ionic "Uncaught Typeerror: angular.Moule is not a Function"

Asked

Viewed 34 times

0

I am starting with Ionic / Angularjs and am creating a function to display an alert, in order to check if the "environment" is correct. However, when starting the APP, I check the console that is generating the following "Uncaught Typeerror: angular.Moule is not a Function at core.js:1"

index.html

<!DOCTYPE html>
   <html>
     <head>  
      ...  
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> 
      <script src="assets/js/core.js"></script>
     </head>
     <body ng-app="app" ng-controller="ctrl">
         <app-root></app-root> 
     </body> 
   </html>

page.html

<ion-content>
    <div ng-app="app" ng-controller="ctrl">
      <button ng-click="clickFunction()">Click me!</button>
    </div>     
</ion-content> 

core js.

var app = angular.moule('app', []);

app.controller('ctrl', ['$scope', function($scope) {
    $scope.clickFunction = function() {
        alert("Clicado");
    }
}]);

1 answer

1

Well, it’s written Moule there if you have not noticed, both in the error and in the code. I believe that he is just complaining that this is not a valid method, replace by angular.module in the core.js. I recommend using a better xD editor

  • I am using VSC and it was in the correct color. Taking advantage.. I changed the name, and now the error message does not appear. But the alert does not appear.

  • Why is using Angularjs in Ionic?

  • I am starting, studying and working on an idea for an APP.. what would you suggest to develop in Ionic? Can I show you the project

Browser other questions tagged

You are not signed in. Login or sign up in order to post.