从原始角度路由器更新到角度组件路由器会产生错误:

时间:2016-11-11 12:48:27

标签: javascript angularjs angular-components angularjs-1.5 angular-component-router

请参阅此处的代码:http://plnkr.co/edit/xIRiq10PSYRsvNE0YWx7?p=preview

我收到以下2个错误。

  
      
  1. 路由必须提供路径或正则表达式属性
  2.   
  3. [$编译:ctreq]           http://errors.angularjs.org/1.5.3/ $编译/ ctreq P0 = ngOutlet&安培; P1 = ngOutlet
  4.   

的index.html

<!DOCTYPE html>
<html ng-app="favMoviesList">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js</script>
<script src="https://unpkg.com/@angular/router@0.2.0/angular1/angular_1_router.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" />
<script src="module.js"></script>
<script src="movies-list-component.js"></script>
<script src="movie-rating-component.js"></script>
<script src="movie-app-component.js"></script>
</head>

<body>
<movie-app></movie-app>
</body>

</html>

module.js

(function(){
var module = angular.module("favMoviesList",["ngComponentRouter"]);

module.value("$routerRootComponent","movieApp");

module.component("appAbout",{
template:"This is about page"
});
}());

电影应用内-component.js

(function(){
var module = angular.module("favMoviesList");

module.component("movieApp",{
templateUrl:"movie-app-component.html",
$routeConfig:[
  { path:"/list",component:"movieList",name:"List"},
  { path:"/about",component:"appAbout",name:"About"},
  { paht:"/**", redirectTo:["List"] }]
});
}());

1 个答案:

答案 0 :(得分:0)

您输错了:paht应为path

第二个错误是因为无法找到指令&#39; ngOutlet&#39;所需的控制器&#39; ngOutlet&#39; < / p>