title: Angular JS function not defined error
body: <p>I am learning AngularJS from AngularJS.org video tutorials but when I run my code it says </p>
  
  <blockquote>
    <p>Error: [ng:areq] Argument 'ReviewController' is not a function</p>
  </blockquote>
  
  <p>I got undefined in my console but my code looks the same as in the video here is my html</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="store"&gt;
  &lt;title&gt;Testing AngularJS&lt;/title&gt;
  &lt;head&gt;
      &lt;link rel="stylesheet" type="text/css" href="bootstrap.css"/&gt;
      &lt;script type="text/javascript" src="js/angular.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-controller="StoreController as store"&gt;
  &lt;ul class="list-group"&gt;
      &lt;li class="list-group-item" ng-repeat="product in store.products"&gt;
          &lt;h3&gt;{{product.name}}
              &lt;em class="pull-right"&gt;{{product.price | currency}}&lt;/em&gt;
              &lt;img class="gallery" ng-src="{{product.images[0].full}}"/&gt;
          &lt;/h3&gt;
  
          &lt;section ng-controller="PanelController as panel"&gt;
              &lt;ul class="nav nav-pills"&gt;
                  &lt;li ng-class="{active: panel.isSelected(1)}"&gt;&lt;a href ng-click="panel.selectTab(1)"&gt;Description&lt;/a&gt;&lt;/li&gt;
                  &lt;li ng-class="{active: panel.isSelected(2)}"&gt;&lt;a href ng-click="panel.selectTab(2)"&gt;Specifications&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li ng-class="{active: panel.isSelected(3)}"&gt;&lt;a href ng-click="panel.selectTab(3)"&gt;Reviews&lt;/a&gt;&lt;/li&gt;
  
  
              &lt;/ul&gt;
              &lt;div class="panel" ng-show="panel.isSelected(1)"&gt;
                  &lt;h3&gt; Description&lt;/h3&gt;
  
                  &lt;h4&gt;{{product.description}}&lt;/h4&gt;
  
              &lt;/div&gt;
              &lt;div class="panel" ng-show="panel.isSelected(2)"&gt;
                  &lt;h3&gt; Specifications&lt;/h3&gt;
                  &lt;blockquote&gt;None yet&lt;/blockquote&gt;
  
              &lt;/div&gt;
              &lt;div class="panel" ng-show="panel.isSelected(3)"&gt;
  
                  &lt;h3&gt; Reviews&lt;/h3&gt;
  
                  &lt;blockquote ng-repeat="review in product.reviews"&gt;
                      &lt;b&gt;Stars: {{review.stars}}&lt;/b&gt;
                     &lt;p&gt;{{review.body}}&lt;/p&gt;
                      &lt;cite&gt;_{{review.author}}&lt;/cite&gt;
                  &lt;/blockquote&gt;
                  &lt;form name="reviewForm" ng-controller="ReviewController as reviewCtrl"&gt;
                      &lt;blockquote&gt;
                          &lt;b&gt;Stars: {{reviewCtrl.review.stars}}&lt;/b&gt;
                          &lt;p&gt;{{reviewCtrl.review.body}}&lt;/p&gt;
                          &lt;cite&gt;_{{reviewCtrl.review.author}}&lt;/cite&gt;
                      &lt;/blockquote&gt;
                      &lt;label for="select"&gt;Select&lt;/label&gt;
                      &lt;select id="select" ng-model="reviewCtrl.review.stars"&gt;
                          &lt;option  value="1"&gt;1 star&lt;/option&gt;
                          &lt;option value="2"&gt;2 star&lt;/option&gt;
                          &lt;option value="3"&gt;3 star&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;label for="comments"&gt;&lt;/label&gt;
                      &lt;textarea id="comments" ng-model="reviewCtrl.review.body"&gt;&lt;/textarea&gt;
                      &lt;label for="email"&gt;Email&lt;/label&gt;
  
                      &lt;input ng-model="reviewCtrl.review.author" type="email" id="email"/&gt;
                      &lt;input type="submit" value="Submit"/&gt;
  
                  &lt;/form&gt;
  
  
              &lt;/div&gt;
          &lt;/section&gt;
  
      &lt;/li&gt;
  
  
  &lt;/ul&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my app.js file</p>
  
  <pre><code>(function () {
  
      var app = angular.module('store', []);
      app.controller('StoreController', function () {
          this.products = [
              {
                  name: 'Cup',
                  price: 2.95,
                  description: 'It is the best Buy it fast',
  
                  images: [
                      {
                          full: 'gem.jpeg'
                      }
                  ],
                  reviews: [
                      {
                          stars: 5,
                          body: 'This is the best gem',
                          author: 'dadsa@dasasd.com'
                      },
                      {
                          stars: 1,
                          body: 'easily broken',
                          author: 'zzzfasdaadsa@dasasd.com'
                      }
                  ]
  
              },
              {
                  name: 'Bottle',
                  price: 1.12,
                  description: 'It\'s the best bottle',
  
                  images: [
                      {
                          full: 'gem.jpeg'
                      }
                  ],
                  reviews: [
                      {
                          stars: 2,
                          body: 'Latest gem',
                          author: 'aasdsa@dasasd.com'
                      }
                  ]
  
              }
          ]; // product is the property of the controller
      });
      app.controller("ReviewController", function () {
          this.review = {};
      });
  
      app.controller("PanelController", function () {
          this.tab = 1;
          this.selectTab = function (setTab) {
              this.tab = setTab;
  
          };
          this.isSelected = function (checkTab) {
              return this.tab === checkTab;
          };
      });
  
  
  })();
  </code></pre>