Currently, I am in the process of learning Angular through this informative video:
http://www.youtube.com/watch?v=LJmZaxuxlRc&feature=share&list=PLP6DbQBkn9ymGQh2qpk9ImLHdSH5T7yw7
The main objective of the tutorial is to create a rollover effect on an element triggering an alert box. However, upon starting the application, an error is being thrown by the console:
Uncaught Error: No module: twitterApp
Despite copying the code exactly as it is, I am unsure of where I might have made a mistake. Feel free to explore a demo and view the code details below:
http://plnkr.co/edit/tLsD394P0WmeQqLBm8F8?p=preview
<div ng-app="twitterApp">
<div ng-controller="AppCtrl">
<div enter="loadMoreTweets()">Roll over to load more tweets</div>
</div>
</div>
var app = angular.module('twitterApp', [])
app.controller("AppCtrl", function ($scope) {
$scope.loadMoreTweets = function () {
alert("Loading tweets!");
}
})
app.directive("enter", function () {
return function (scope, element, attrs) {
element.bind("mouseenter", function () {
scope.$apply("loadMoreTweets()")
})
}
})
UPDATE: The functionality did not work locally on Google Chrome but worked perfectly on Safari.