Uncaught Error: [$injector:modulerr] in angular 1.3

Problem

I'm new to angular.js and I tried to develop a small application using angular.js 1.3.2. I am getting this error that I do not understand. Why is this error occurring?

index.html

<!DOCTYPE html>
  <html ng-app='store'>
    <body>      
      <script type="text/javascript" src="angular.min.js">
      </script>             
      <script type="text/javascript" src="app.js">
      </script>     
      <div ng-controller="StoreController">
        <h1>
          {{StoreController.product.title}}
        </h1>
      </div>
    </body>
  </html>

app.js

(function(){
  var app = angular.module('store', []);  
  app.controller('StoreController', function(){
  this.product = gem;  
  });
  var gem = {
  title: "hello",
  description: "nnothing gr8"
  }
}); 
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.2/$injector/modulerr?p0=store&p1=Error%3A%2…F%2Fhome%2Fnaveed%2FDocuments%2Fwork%2Fangular%2Fangular.min.js%3A17%3A381) angular.js:4020
Problem courtesy of: Naveed B

Solution

shouldn't you need $scope variables tied to the view?

<h1>
      {{product.title}}
</h1>

so you need to inject $scope to get things working:

(function(){
  var app = angular.module('store', []);  
  app.controller('StoreController', function($scope){
      var gem = {
          title: "hello",
          description: "nnothing gr8"
      }
      $scope.product = gem;  
  });

})(); // your function needs to be run  
Solution courtesy of: SoluableNonagon

Discussion

(function(){
var app = angular.module('store',[]);

app.controller('StoreController', ['$scope', function($scope) {
$scope.product = gem;
}]);

var gem={
  title: "hello",
  description: "nothing gr8"
}
})();
Discussion courtesy of: Naveed B

This recipe can be found in it's original form on Stack Over Flow.