We need to reference it in our main template by adding a line inside the tag. We will also add the AngularJS data-ng-app declaration and initialize the Angular app. Here is the listing for app/views/main.scala.html :

We’ve added some Angular attributes to HTML elements, specifically the attributes beginning with ‘data-ng’. Angular will handle binding values and functions to these elements. The Angular code for this we’ll put in public/javascripts/hello.js which was created when we specified the play-scala template at project creation time.

The main things to notice are that the doSearch function which in javascript is $scope.doSearch() and in the data-ng-onchange attribute is just “doSearch()”, and also the url for the search would be better as a parameter then we can have Play generate it. I used this technique in Tutorial #13.