angularjs - Angular UI Bootstrap Typeahead -
i using angular js first time.
here code , not working. typeahead intellisense showing 'unknown attribute'.
<div class='container-fluid' ng-controller="homecontroller"> <h4>search state</h4> <pre>model: {{selected | json}}</pre> <input type="text" autocomplete="off" ng-model="selected" typeahead="state state in states | filter:$viewvalue | limitto:8" class="form-control"> </div> function homecontroller($scope, $http) { $scope.selected = undefined; $scope.states = ['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']; }
am missing js files ?
please see working example here http://plnkr.co/edit/sjasfl8bkkdjlrxulgva?p=preview
make sure you've got scripts
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script>
and definition of app include ui.bootstrap
var app= angular.module('app', ['ui.bootstrap']);
Comments
Post a Comment