angular-ui / angular-google-maps

AngularJS directives for the Google Maps Javascript API
http://angular-ui.github.io/angular-google-maps
2.52k stars 1.07k forks source link

Bug: Searchbox does not allow use of directives in template #1702

Open blowsie opened 8 years ago

blowsie commented 8 years ago

Using the searchbox template works for css classes and so on, but does not work with angular directives.

eg. (ng-keypress in this scenario doesn't work, any other directive I tried also doesn't work)

 <script type="text/ng-template" id="searchbox.tpl.html">
        <input type="text" placeholder="Keypress broken" ng-keypress="myFunc($event)">
 </script>

http://plnkr.co/edit/twgfjseojXS9OWDg9dzg?p=preview

kandizzy commented 8 years ago

@blowsie i implemented ng-model a while back, there's an example on how to use that in the examples folder. I haven't looked at implementing other directives. I'll take a look, but if you want to dig in and create a PR that would be awesome too. Which other directives would you want to use?

blowsie commented 8 years ago

@kandizzy Thanks!

I did take a look and tried implementing $compile, but it did not achieve what I had wanted.

nmccready commented 8 years ago

@blowsie feel free to add this extra functionality to the directive via a PR . @kandizzy is the main driver of it; but should could use some support.

blowsie commented 8 years ago

@nmccready Sadly I can't figure out what the actual problem is, any pointers anyone?

nmccready commented 8 years ago

Ill try and take a look

kandizzy commented 8 years ago

@nmccready @blowsie

here's some info on how ng-model works. adding a whole bunch of directives this way is not ideal, I'll take a look at it again.

$compile is called on the template here: https://github.com/angular-ui/angular-google-maps/blob/master/src/coffee/directives/search-box.coffee#L54

to make ng-model work i passed it from the directive here: https://github.com/angular-ui/angular-google-maps/blob/master/src/coffee/directives/search-box.coffee#L37