2016-04-25 3 views
0

マップを使用しない検索フィールドがあります。入力フィールドにオートコンプリートオプションを使用することは可能ですか?

HTML

<input type="text" ui-gmap-search-box ng-model="GeneralFactory.Location" events="searchbox.events" placeholder="Location" class="form-control input-lg">

app.js

app.config(['uiGmapGoogleMapApiProvider', function (GoogleMapApi) { 
    GoogleMapApi.configure({ 
     // key: 'your api key', 
     // v: '3.20', 
     libraries: 'places' 
    }); 
}]); 

app.controller('mainCtrl', ['$scope', '$log', 'uiGmapGoogleMapApi', function ($scope, $log, GoogleMapApi) { 
    angular.extend($scope, { 
     searchbox: { 
      events:{ 
       places_changed: function (searchBox) {} 
      } 
     }, 
     options: { 
      scrollwheel: false 
     } 
    }); 

    GoogleMapApi.then(function(maps) { 
     maps.visualRefresh = true; 
    }); 
}]); 

私が欲しいのは、場所の自動補完です。しかし、これは次のエラーをスローする

Error: [$compile:ctreq] Controller 'uiGmapGoogleMap', required by directive 'uiGmapSearchBox', can't be found!

私はマップ内に検索ボックスを置かないので、これが考えられます。私はマップを使用したくないので、ここで何ができますか?

答えて

関連する問題