angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
315 stars 137 forks source link

document issues when minifying html or change name of control to something else #158

Open nmccready opened 8 years ago

nmccready commented 8 years ago

From @stev-0 on April 22, 2015 10:9

I have spent quite some time debugging an issue with angular-leaflet-directive. It turned out to be due to the html minification process. I had

<leaflet center="centre" controls="controls" layers="layers" width="1200px" height="800px"></leaflet>

And because controls="controls" is a standard html attribute, the minifier was reducing it to,

<leaflet center="centre" controls layers="layers" width="1200px" height="800px"></leaflet>

which I didn't pick up on for quite a while.

Might it be possible to change the name of controls to something like leaflet-controls to stop this happening in future? Or alternatively is there a manual, documentation or faq that I could add this too. If not happy to create one.

There is more info on the stackoverflow question

Copied from original issue: tombatossals/angular-leaflet-directive#726

nmccready commented 8 years ago

From @tombatossals on June 26, 2015 17:36

You're totally right, we have this issue, but haven't changed it yet because of the broken compatibility it supposes.

@nmccready, @jessertaylor what do you think about this? Maybe we can rename the sub-directives names for the next release version, something like:

<leaflet lg-center="center" lg-controls="controls">

What do you think about this?

nmccready commented 8 years ago

while your at it you should also do leaflet to lg-leaflet, as it becomes less likely to collide with other directives.

nmccready commented 8 years ago

From @tombatossals on June 27, 2015 7:10

That's right, we should rename all directives including the main one with a directive prefix. Maybe we could consider adding these changes when leaflet 0.8 is released, that would be less painful.

nmccready commented 8 years ago

From @tombatossals on June 27, 2015 7:11

Related: https://github.com/tombatossals/angular-leaflet-directive/issues/348

nmccready commented 8 years ago

Sounds like a good idea.

nmccready commented 8 years ago

From @boeckMt on August 12, 2015 8:10

i had the same issue... maybe as workaround till the renaming is done, prefixing the attributes with "data-" works for me with minifying.