0

See the code here: http://plnkr.co/edit/xIRiq10PSYRsvNE0YWx7?p=preview.

I'm getting the following 2 errors.

  1. Route must provide either a path or regex property
  2. [$compile:ctreq] http://errors.angularjs.org/1.5.3/$compile/ctreq?p0=ngOutlet&p1=ngOutlet

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"
});
}());

movie-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"] }]
});
}());
nikhil
  • 5
  • 3

1 Answers1

0

You made a typo: paht should be path.

The second error is because your controller 'ngOutlet', required by directive 'ngOutlet', can't be found.

Matheno
  • 4,112
  • 6
  • 36
  • 53
  • Thanks for the reply. Regarding second error, from my understanding ng-outlet is just like ng-view. So, I added it in **movie-app-component.html** earlier itself. I did not understand. Can you be more specific. Thanks. – nikhil Nov 11 '16 at 18:55