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

[develop] ng-show within window not working #382

Closed
ghost opened this issue Apr 23, 2014 · 21 comments
Closed

[develop] ng-show within window not working #382

ghost opened this issue Apr 23, 2014 · 21 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Apr 23, 2014

When I use ng-show within the window directive, my strong-tag won't show although the expression is true. I put the expression I'm using outside the ng-show and then it says "true", so the expression is indeed true.
This is only an issue on the development version, as it does work on the release version.

I created a plunker to show my problem.
http://plnkr.co/edit/A6eDExMqECldHAOLcVGP

@ghost
Copy link
Author

ghost commented Apr 28, 2014

I created a simplified version of the previous plunker.

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

@ghost ghost changed the title ng-show within window not working on development [develop] ng-show within window not working Apr 28, 2014
@francisdb
Copy link

We are having the same problem. Does anybody have a hint on how this could be fixed or where the actual issue is? This is a regression as it works on master...

@nmccready
Copy link
Contributor

I'll add it to 1.1.0 milestone.

@nmccready
Copy link
Contributor

This probably happened due to the efforts of getting clicking to work inside a window. If ng-show is not working though the main controller it might need a sub-controller like infoWindowController (in the examples).

@nmccready
Copy link
Contributor

Areas that changed and compile the template.

This is for the actual child (after) it has been interpolated by windows parent.
https://github.com/nlaplante/angular-google-maps/blob/develop/src/coffee/directives/api/utils/gmap-util.coffee#L44-L68

@nmccready
Copy link
Contributor

Is this on both windows and window directive?

@francisdb
Copy link

We are using window

@nmccready
Copy link
Contributor

@nmccready
Copy link
Contributor

Window is much easier to debug, however the fix needs to work for both.

@francisdb
Copy link

Hmm, I fear my angular skills are not adequate to understand everything you are explaining but thanks for looking into this issue.

@nmccready
Copy link
Contributor

Ok I'll get to it when I can.

@nmccready
Copy link
Contributor

@BenSwennen @francisdb I am pretty sure this is not a bug but a mis-understanding of how things work. I believe this is the same situation on how to get things to work with a button click within a window. Therefore you will need a second controller which is bound to each window and you will use it's scope function and properties. Please see the examples for inforWindowController. I will verify this.

@francisdb
Copy link

@nmccready So why this complexity of adding another controller, can't this "just work" as one would expect?

@nmccready
Copy link
Contributor

I am not entirely sure yet but I know that the other way works. @nlaplante might have a better explanation as he originally got the clicking to work.

@nmccready
Copy link
Contributor

I think I can maybe explain it a little better. You need to break the idea that window being created via the directive is alway attached to the main controller. Once it is created by google it is detached from the scope of any controller. Therefore we need to rebind it to another controller which injects itself into the real window. The {{m.whatever}} portion is only being used for compiling of the html which is handed off to the google options to create the html.

@nmccready
Copy link
Contributor

I am editing the plunkr. Maybe a possible improvement of this can come at later time, but the work around should be sufficient for this release.

@francisdb
Copy link

Ok, thanks, that should at least get us going 👍

@nmccready
Copy link
Contributor

@knapeto
Copy link

knapeto commented Jan 5, 2015

Hey all,

I have still problem with ng-show..

I have dynamic selected.

<ui-gmap-window coords="selected" show="selected.show" closeClick='selected.onMarkerClose()' ng-cloak>

    <div style="min-width: 230px;">

        <div ng-show="selected.atest">aaa</div>

        <div ng-show="selected.btest">bbb</div>

    </div>

</ui-gmap-window>

@abdellah-neo
Copy link

For people still experiencing this issue: you can use :
ng-show="{{boolean}}
It works just fine

@nmccready
Copy link
Contributor

Thanks @abdellah-neo

@angular-ui angular-ui locked and limited conversation to collaborators Sep 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants