angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

SearchBox : is there a way to pass a template as string instead of path?

Open xavhan opened this issue 7 years ago • 0 comments

When we use <ui-gmap-search-box> the template attribute expect an url string to work.

// controller.js
this.searchbox = { template:  'searchfield.template.html' };
<!-- template.html -->
<ui-gmap-search-box
  template="$ctrl.searchbox.template"
  ...
</ui-gmap-search-box>

but if we want to import a template from a html file and pass it to the directive that does not work as expected.

// controller.js
import searchFieldTemplate from './searchfield.template.html';
this.searchbox = { template: searchFieldTemplate  };
<!-- template.html -->
<ui-gmap-search-box
  template="$ctrl.searchbox.template"
  ...
</ui-gmap-search-box>

Is there a way to do pass a tempalte or a directive/component as a template?

Should'nt we change the template attribute to a more semantic template-url attribute?

Version

2.3.3

xavhan avatar Oct 06 '16 18:10 xavhan