admin管理员组

文章数量:1290971

I got this error: "TypeError: d.$$minErr is not a function". It 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
   }
});

I got this error: "TypeError: d.$$minErr is not a function". It 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
   }
});
Share Improve this question asked Jul 8, 2015 at 21:44 thadeuszlaythadeuszlay 3,0157 gold badges37 silver badges71 bronze badges 7
  • Can you add plunker with error? – milanlempera Commented Jul 9, 2015 at 4:33
  • With plunker, do you mean this? – thadeuszlay Commented Jul 9, 2015 at 4:36
  • yes, you can create there simple example with error. – milanlempera Commented Jul 9, 2015 at 4:42
  • plnkr.co/edit/L1BDaRmnPCfTemG6lSiu?p=preview – thadeuszlay Commented Jul 10, 2015 at 7:26
  • @milanlempera: The save feature faild somehow. Maybe you can access it for colloboration: 2uTt6K3n389u5Pjb – thadeuszlay Commented Jul 10, 2015 at 7:27
 |  Show 2 more ments

1 Answer 1

Reset to default 10

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

I think, you have inpatible versions of angular and angular-router. Versions of both should be same.

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

本文标签: javascriptTypeError dminErr is not a function in angularrouteminjsStack Overflow