-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use controllerAs syntax on controls attribute #348
Comments
You're right, good point. What would you suggest to solve this? Rename the attribute, like "lfControls", for example? |
I believe renaming the attribute is the only option. Since Angular will As for your namespace suggestion, that would work but it should be applied Stephen
|
Got a similar problem. I used grunt-contrib-htmlmin task to minimize my html and since controls is a HTML5 attribute and my scope variable is named controls (<leaflet controls="controls"></leaflet>), it got renamed to <leaflet controls></leaflet>. The htmlmin task option collapseBooleanAttributes was set to true, therefore controls="controls" was collapsed to controls since it's an html5 attribute... Any idea if the attributes will be renamed soon to prevent this type of conflict? |
This issue was moved to angular-ui/ui-leaflet#18 |
I'm going to rework&redesign angular-leaflet-directive to be compatible with Leaflet v1.0. It will mantain almost all its functionality, and will be compatible with the current features of the directive, but I must start from a fresh point, so I'm going to close this issue. If you think it must be worked with the new version, please reopen it. |
jQuery considers the attribute "controls" as a reserved word and will rename any string to simple "controls". Look at the jQuery.js source code lines 623 & 6888 for 2.1.0 and 665 & 7960 for 1.11.0. I do not believe jqLite has this same issue.
For example:
Before $compile:
After $compile:
NOTE: I removed the other attributes and classes for brevity.
The only workaround if jQuery is required is to use the variable name "controls" and assign it to the $scope.
The text was updated successfully, but these errors were encountered: