-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat($compile, jqLite): Change directive definition object to allow temp... #5419
Conversation
I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let me know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
…emplates to be created within a given xml namespace When creating a new directive and a template was specified, along with the replace option being set to true in the Directive Definition Object angular would create the elements contained within the template with the namespace of the HTML page. Whilst this is fine for the vast majority of the cases if you ever need to use xml in your template as in SVG this causes a problem. As the newly created elements are in the HTML namespace and not SVG. This change introduces a new property on the Directive Definition Object "templateNS". This new property allows you to pass in a string to serve as the default namespace for the elements or to pass in an object. Where key is the xml prefix and value is the namespace.
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
Would be very interested in seeing something like this happen. The failing tests are for IE8 only, from what I can see, so this should probably be changed to the 1.3.x milestone. As an aside, how often would you need to use an XML namespace other than SVG? Could we simplify things by only adding SVG support? |
Yes that is right, the tests that were introduce as part of this pull request are only failing in IE 8. Unfortunately I don't have access to a machine with IE 8 installed on to try and debug this. From what I have read IE 8 does not natively support SVG(my prime motivation for submitting this pull request). I also remember reading that IE 8 support is planing to be discontinued in Angular 1.3. So I have been reluctant to put too much time into making it work and hoping for some feedback from the community to see how useful it is to have this feature supported in IE 8. In answer to your other question about how often you would need to use another XML namespace. I would imagine that the vast majority of people (myself included) would use this purely for SVG. However there are a few other xml based documents that can potential be displayed in a browser the ones that I know of are MathML and RDF. I would like not to block developers from using Angular with those technologies just because of a namespace issue. |
Hmm, we've got like 3 different solutions to this one issue now ;) I think (hope) that the shadow dom will be a better solution to all of this, but I'm not totally sure. |
02dc2aa
to
fd2d6c0
Compare
cad9560
to
f294244
Compare
e8dc429
to
e83fab9
Compare
4dd5a20
to
998c61c
Compare
Other solutions landed that would make svg automatically detected. If this is not the case, feel free to reopen this issue or create a new issue |
...lates to be created within a given xml namespace
When creating a new directive and a template was specified, along with the replace option being set to true in the Directive Definition Object angular would create the elements contained within the template with the namespace of the HTML page. Whilst this is fine for the vast majority of the cases if you ever need to use xml in your template as in SVG this causes a problem. As the newly created elements are in the HTML namespace and not SVG.
This change introduces a new property on the Directive Definition Object "templateNS". This new property allows you to pass in a string to serve as the default namespace for the elements or to pass in an object. Where key is the xml prefix and value is the namespace.