This code in a simple HTML file works:
>
Call your function with ng-init
ng-init
var app = angular.module('app',[]); app.controller('myController', function($scope){ $scope.load = function () { alert("load event detected!"); } });