I'm just starting out with AngularJS and have hit a really simple snag that I just can't seem to get past. All I want to do is initialize some values when the page loads. It doesn't happen. Here's the code:
var bookingAppModule = angular.module('bookingApp', []);
bookingAppModule.controller('bookingController', ['$scope', function ($scope) {
$scope.bookingDate = '2014/04/28';
$scope.alertMessage = "initialized";
}]);
</script>
<div id ="booking-app" ng-app="bookingApp"">
<div >
{{bookingDate}}<br />
<input type="date" ng-model="bookingDate" />
<br />
{{alertMessage}}
</div>
</div>
What am I missing here? BTW, I also tried putting an init() function on the controller and using ng-init= "init()", but that doesn't work either. I can initialize the values using ng-init ="bookingDate= ...", but that is not what I want.