first day with angular; what am I doing wrong?

It is my first day and I'm trying to get a simple even workign but it isn't. Here's a fiddle: http://jsfiddle.net/LKktL/

<body ng-app>
 <div ng-controller='EventAddCtrl'>
    <p>Nothing here {{'yet' + '!'}}</p>
 <div class='first-test' ng-click="say_hello()">angular test to say hello</div>
</div>   
</body>

function EventAddCtrl($scope){
  $scope.say_hello = function() {
    alert('hello in there');
  }
}​

It's obviously not working and trying to figure out why. thx in advance

In your JSFiddle Angular is being executed during the onLoad event. Open your browser console and you'll find the following error thrown by Angular

    Error: Argument 'EventAddCtrl' is not a function, got undefined

Your App has failed to initialized.

The onLoad event is fired at the end of the document loading process. Angular initializes your app during the DOMContentLoaded event, which is fired after the DOM has been parsed but before the DOM is ready and before the document is fully loaded. In other words, make sure the library is parsed and executed before any of those events by either including it between <head> or <body> HTML tags. A good practice is to place it just before the closing <body> tag.

As others have mentioned, when using JSFiddle, use either no wrap(head) or no wrap(body).

There are two wrong usages in your fiddle.

  1. do not need to select onload, select no wrap(head) or no wrap(body) are both ok.
  2. do not need to place a <body> tag in html panel which is already out there, and expand the info menu in the left panel, fill the Body Tag with <body ng-app>.

for more infomation, plz take a look at this page fiddle documentation.

You have some setting problems with jsFiddle. Here is the working jsFiddle

You can try plunker. It works pretty good like jsFiddle.

1.Add Body tag <body ng-app>

2.pick "no wrap (head)"