I have a question about the element of the Angular Google Maps plugin. The example source code in documentation for the Windows element uses the ng-non-bindable
attribute for the <div>
inside of the <ui-gmap-windows>
element. Apparently, this is necessary in order for Angular bindings to render correctly on the page. This is not explicitly stated in the documentation, so I am wondering exactly why this attribute is necessary, especially since the official Angular documentation on ng-non-bindable makes it clear that Angular literals within annotated HTML elements will not be parsed by Angular.
To illustrate, this is a snippet of code in my HTML partial (assume that the attribute model in scope for this windows element has a name and a description field):
<ui-gmap-markers models="markers" coords="'self'">
<ui-gmap-windows>
<div>{{name}}: {{description}}</div>
</ui-gmap-windows>
</ui-gmap-markers>
Without ng-non-bindable
as an attribute to the <div>
(or with no div), the model's values will not be bound to these Angular literals. Just the colon would be rendered in the window, as in ":". But, once I put in the attribute:
<ui-gmap-markers models="markers" coords="'self'">
<ui-gmap-windows>
<div ng-non-bindable>{{name}}: {{description}}</div>
</ui-gmap-windows>
</ui-gmap-markers>
then the window's text will render correctly. It will say something like "Location 1: This is where Location 1 is."
So once again, I am wondering why ng-non-bindable is exactly required here. It will greatly help me better understand this Angular library, and perhaps Angular as a whole, better.
<ui-gmap-markers>
? – Haberdasher