Error: [ng:areq] Argument 'PostsCtrl' is not a function, got undefined


#1

Hi,
I am trying this tutorial :

I added the form :
views/posts.html

In the browser, I see the form, and under it :
Posts: {{ posts }}
Post: {{ post }}

The console said :

Error: [ng:areq] Argument ‘PostsCtrl’ is not a function, got undefined

Please your help is appreciated.
Thanks


#2

The controller is not well created.
in controllers.js use this code:

.controller('PostsCtrl', function($scope){
  console.log('posts controllers loaded');
  $scope.post = {id: 0, title: 'post title', date:'2015/10/10'};
})

Whith this you sould see at least something where in your view have post: {{post}} (replacing {{post}})