我正在尝试遵循本教程:
https://angular.github.io/router/getting-started
为什么 AppController.$routeConfig 未定义?
angular.module('app', ['ngNewRouter', 'app.home'])
.controller('AppController', ['$router', AppController]);
AppController.$routeConfig([
{path: '/', component: 'home' }
]);
function AppController ($router) {}
我的html:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="/">
<title>My app</title>
</head>
<body ng-app="myApp" ng-controller="AppController as app">
<div ng-viewport></div>
<script src="node_modules/angular/angular.js"></script>
<script src="node_modules/angular-new-router/dist/router.es5.js"></script>
<script src="./components/home/home.js"></script>
<script src="app.js"></script>
</body>
</html>