Guest User

Untitled

a guest
Nov 21st, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. apiAddress: string = "";
  2.  
  3. @Output() notify: EventEmitter<any> = new EventEmitter<any>();
  4.  
  5. autoCompleteCallback1(selectedData: any) {
  6.  
  7.  
  8. this.apiAddress = selectedData.description;
  9.  
  10. this.notify.emit(this.apiAddress);
  11. }
  12.  
  13. import { Component, NgModule } from '@angular/core'; import {
  14. Ng4GeoautocompleteModule } from 'ng4-geoautocomplete';
  15.  
  16. @NgModule({
  17. imports: [
  18. Ng4GeoautocompleteModule.forRoot()
  19. ]
  20. })
  21. export class MyModule{}
  22.  
  23. <script type="text/javascript"
  24. src="https://maps.google.com/maps/api/js?sensor=true&key=XXReplace
  25. this with valid keyXX&libraries=places&language=en-US"></script>
  26.  
  27. import { Component } from '@angular/core';
  28.  
  29. @Component({ template: '<ng4geo-autocomplete
  30. (componentCallback)="autoCompleteCallback1($event)"></ng4geo-
  31. autocomplete>'
  32. })
  33.  
  34. export class MyComponent {
  35. autoCompleteCallback1(selectedData:any) {
  36. //do any necessery stuff.
  37. }
  38. }
  39.  
  40. public userSettings2: any = {
  41. showRecentSearch: false,
  42. geoCountryRestriction: ['in'],
  43. searchIconUrl: 'http://downloadicons.net/sites/default/files/identification-search-magnifying-glass-icon-73159.png'
  44. };
  45.  
  46. <ng4geo-autocomplete [userSettings]="userSettings2" (componentCallback)="autoCompleteCallback2($event)"></ng4geo-autocomplete>
Add Comment
Please, Sign In to add comment