0
看到代码在这里:http://plnkr.co/edit/xIRiq10PSYRsvNE0YWx7?p=preview。从原来的角度路由器更新角部件路由器给出的错误:
我收到以下2个错误。
- 路线必须提供一个路径或正则表达式特性
- [$编译:ctreq] http://errors.angularjs.org/1.5.3/ $编译/ ctreq P0 = ngOutlet & P1 = ngOutlet
索引.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/[email protected]/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"
});
}());
电影APP-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"] }]
});
}());
感谢您的回复。关于第二个错误,从我的理解ng-outlet就像ng-view。所以,我将它添加到** movie-app-component.html **之前。我不明白。你可以说得更详细点吗。谢谢。 – nikhil