使用x-editable注入$ routeProvider时出错

时间:2017-03-16 17:42:32

标签: javascript angularjs x-editable ngroute route-provider

我安装了x-editable并且它正在工作,现在我添加路由我收到此错误https://docs.angularjs.org/error/ $ injector / unpr?p0 = $ routeProvider,显示未知提供者:$ routeProvider。

我不确定如何解决这个问题。

github链接:https://github.com/radmint/angular-book-conversion/tree/x-editable-with-ng-route

的index.html:



<head>
  <meta charset="utf-8">
  <title>Books and Databases</title>
  <link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  <script src="vendors/angular.js" charset="utf-8"></script>
  <script src="vendors/xeditable.js" charset="utf-8"></script>
  <script src="vendors/angular-route.js" charset="utf-8"></script>
  <script src="scripts/client.js" charset="utf-8"></script>
  <script src="scripts/controllers/book.controller.js" charset="utf-8"></script>
  <link href="styles/xeditable.css" rel="stylesheet">
</head>
&#13;
&#13;
&#13;

client.js:

&#13;
&#13;
var app = angular.module('BookApp', ['ngRoute','xeditable']);


app.config(['$routeProvider', function($routeProvider) {
  $routeProvider
    .when('/booksList', {
      templateUrl: '/views/books.html',
      controller: 'BookController',
      controllerAs: 'bc'
    })
    .otherwise({
      redirectTo: '/booksList'
    });
}]);

app.run(function(editableOptions) {
  editableOptions.theme = 'bs3';
});
&#13;
&#13;
&#13;

0 个答案:

没有答案