html - Uncaught Error: No module: angularTypeahead -


angular typeahead throws me uncaught error: no module: angulartypeahead. using angular typeahead @ project. have added script index.html, this:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js"></script> <script src="http://angular-ui.github.com/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script> <script src="js/angular/app.js"></script> 

index.html:

<div class="row center" ng-app="angulartypeahead">     <div style="margin-top:0px;" class="col l12 s12 m12" ng-controller="typeaheadctrl">     <h4 class="header col s12 light">name         <input name="location" id="location" type="text"                placeholder="change location" ng-model="selected"                typeahead="area area in areas| filter:$viewvalue | limitto:8"                class="form-control">     </h4>     <a class="waves-effect waves-light btn red">         <i class="material-icons left"></i>change location</a>     </div> </div> 

app.js:

(function(){     var app = angular.module('angulartypeahead',['ui.bootstrap']);      app.controller('typeaheadctrl', function($scope) {         var areas = ["alabama", "alaska", "arizona", "arkansas",                      "california", "colorado", "connecticut", "delaware",                      "florida", "georgia", "hawaii", "idaho", "illinois",                      "indiana", "iowa", "kansas", "kentucky", "louisiana",                      "maine", "maryland", "massachusetts", "michigan",                      "minnesota", "mississippi", "missouri", "montana",                      "nebraska", "nevada", "new hampshire", "new jersey",                      "new mexico", "new york", "north dakota", "north carolina",                      "ohio", "oklahoma", "oregon", "pennsylvania",                      "rhode island", "south carolina", "south dakota",                      "tennessee", "texas", "utah", "vermont", "virginia",                      "washington", "west virginia", "wisconsin", "wyoming"];          $scope.selected = undefined;          $scope.areas = areas;      }); }); 

i have found lots of discussion regarding issue nothing changes error. hope on issue. thanks!..

you should invoke function parenthesis. (function(){ ... })()

or don't wrap in function.

var app = angular.module(); app.controller();  

Comments