TypeError: d. $$ minErr is not a function in angular-route.min.js

I got this error: "TypeError: d. $$ minErr is not a function". Seems to be a problem with angular-route.

My code: index.htm:

<!DOCTYPE html>
<html ng-app="myApp" lang="en">
    <head>        
        <script src="js/angular.min.js"></script>
        <script src="js/angular-route.min.js"></script>
        <script src="app.js"></script>
        <meta charset="utf-8"/>
    </head>
    <body>
        <search-result></search-result>
    </body>
</html>

      

app.js

var myApp = angular.module('myApp', ['ngRoute']);

myApp.config(function($routeProvider){ 
    $routeProvider
    .when('/', {
        templateUrl: 'pages/main.html',
        controller: 'mainController'
    })

});

// controllers

myApp.directive('searchResult', function() {
   return {
       restrict: 'AECM',
       templateUrl: 'customDirectivePage.html',
       replace: true
   }
});

      

+3


source to share


1 answer


Here is a working example http://plnkr.co/edit/ML2XJxUhWPvym1mYwVCZ?p=preview

I think you have incompatible versions of angular and angular-router. The versions of both should be the same.



<script src="https://code.angularjs.org/1.4.2/angular.js"></script>
<script src="https://code.angularjs.org/1.4.2/angular-route.js"></script>

      

+10


source







All Articles