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

[master][develop] ng-click on a window

Open acroca opened this issue 13 years ago • 19 comments

Hi,

I'm trying to use ng-click on a window but doesn't work. I think it's because the content of the window is a copy of the HTML of the element.

I created a plunker for this. Clicking on the marker it opens a window with a click. The link on the window should move the marker. http://plnkr.co/edit/hS13E8ydDpnBFGPIAuSo

Thanks

acroca avatar Dec 02 '13 12:12 acroca

confirmed @nlaplante how should we handle this?

nmccready avatar Dec 06 '13 04:12 nmccready

I only ask because should we even bother handling ng-click directive when we are using a custom directive?

nmccready avatar Dec 07 '13 02:12 nmccready

I think the HTML within the window should behave as any other html in Angular, just for consistency. Actually I was quite surprised it didn't work.

Albert Callarisa Roca

On Saturday, 7 December, 2013 at 10:20 am, nmccready wrote:

I only ask because should we even bother handling ng-click directive when we are using a custom directive?

— Reply to this email directly or view it on GitHub (https://github.com/nlaplante/angular-google-maps/issues/157#issuecomment-30045287).

acroca avatar Dec 07 '13 03:12 acroca

I only ask because should we even bother handling ng-click directive when we are using a custom directive?

Actually I think ng-click should be the preferred way of handling this.

nlaplante avatar Dec 16 '13 02:12 nlaplante

Fine w me

nmccready avatar Dec 16 '13 02:12 nmccready

I got ng-click to work inside a element. Actually, we called element.html() to specify the content of the window, which only sends html, and not the events attached to the DOM nodes inside it. I changed element.html() to element.get(0) while calling createWindowOptions() and it works fine now. Not commiting right now, since I want to know if you ran into issues with passing a DOM node instead of plain HTML string.

nlaplante avatar Dec 16 '13 02:12 nlaplante

Does it work in markers too?

nmccready avatar Dec 16 '13 02:12 nmccready

Well it's not ready yet! hehe :)

TypeError: Object # has no method 'get'. Need some coffee help there.

Changed:

element.html()

to

element.get(0)

and I got the above error in specs.

nlaplante avatar Dec 16 '13 02:12 nlaplante

k whats the branch name?

nmccready avatar Dec 16 '13 03:12 nmccready

It's not on a specific branch yet. Not committed. I'll create a feature branch for this and let you know.

nlaplante avatar Dec 18 '13 18:12 nlaplante

any progress on this?

nmccready avatar Jan 04 '14 14:01 nmccready

Also am interested in this. Thanks!

robindang avatar Jan 19 '14 23:01 robindang

found this gem http://stackoverflow.com/questions/15613992/ng-click-attribute-on-angularjs-directive

trying to work it in

nmccready avatar Feb 04 '14 02:02 nmccready

Please check if develop has solved your issue. If your looking for ng-click to replace click it has not. However the content compiled inside of a window is now clickable if it is bound to a controller in the window scope. See the examples.

nmccready avatar Feb 16 '14 18:02 nmccready

Has this issue been resolved, and is the fix present in the current master?

yintothayang avatar Feb 20 '14 02:02 yintothayang

To click stuff in a window yes. To replace click to open a window , no. On

nmccready avatar Feb 20 '14 02:02 nmccready

thank you for the quick response!

yintothayang avatar Feb 20 '14 02:02 yintothayang

Its in the example, look for infowindow controller.

nmccready avatar Feb 20 '14 02:02 nmccready

This issue is resolved however I am committing another example to develop.

nmccready avatar Apr 17 '14 22:04 nmccready