Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Is it possible to use the autocomplete option in an input field without the map #1828

Open
@flyingboy007

Description

@flyingboy007

I have a search field that wont use the map.

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;
    });
}]);

All I want is an autocompletion of location. But this throws following error

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

I think this is because I havent put searchbox inside the map. As I dont want to use the map what can I do here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions