title: [$injector:nomod], [$injector:modulerr] error in Angular
body: <p>I'm very new to angular js and following is my code</p>
  
  <pre><code>&lt;script type="text/javascript" src="node_modules/angular/angular.min.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
          (function(angular){
  
              var testAngular = angular.module('testAngular');
  
              testAngular.controller = ("name_controller", function($scope) {console.log("hello");
                  $scope.name = {
                      firstName: "null",
                      lastName: "null",
                      setName: function(fname, lname) {
  
                          if(fname.trim != "") {
                              this.firstName = fname;
                          }
  
                          if(lname.trim()!="") {
                              this.lastName = lname;
                          }
                      },
                      getName: function() {
                          var name_object = $scope.name;
                          return name_object.firstName+" "+name_object.lastName;
                      }
                  };
              });
          })(window.angular);
      &lt;/script&gt;
  
      &lt;div ng-app="testAngular" ng-controller="name_controller"&gt;
          Enter first name: &lt;input type="text" ng-model="name.firstName"&gt;&lt;br&gt;&lt;br&gt;
          Enter last name: &lt;input type="text" ng-model="name.lastName"&gt;&lt;br&gt;
          &lt;br&gt;
          You are entering: {{ name.firstName }}
      &lt;/div&gt;
  </code></pre>
  
  <p>Now when I'm trying to run this code I'm getting 2 errors in console as</p>
  
  <pre><code>[$injector:nomod]
  </code></pre>
  
  <p>and</p>
  
  <pre><code> [$injector:modulerr]
  </code></pre>
  
  <p>Any idea why exactly this is happening. Some post says I need to include the route module but I'm not using routing any where in my code.</p>