ngx-meta icon indicating copy to clipboard operation
ngx-meta copied to clipboard

use universal methods to manipulate the HTML element

Open fulls1z3 opened this issue 8 years ago • 3 comments

I'm submitting a ... (check one with "x")

[ ] bug report => check the README and search github for a similar issue or PR before submitting
[ ] support request => check the README and search github for a similar issue or PR before submitting
[X] feature request

Current behavior In @nglibs/meta v0.2.0-rc.5, manipulating the HTML element (to set the lang attribute) has been commented out, in scope of preventing direct DOM manipulation.

Expected/desired behavior We need to set the lang attribute of HTML element, using universal methods as they become available.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 2.0.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

fulls1z3 avatar Apr 04 '17 09:04 fulls1z3

They did miss that one.. I'm setting it after rendering the HTML for now

samvloeberghs avatar Apr 08 '17 15:04 samvloeberghs

I think I know why they missed that one. It is simply not within the scope of title.service and meta.service.

On the other hand, I could develop a method to do it by using the DomAdapter, but as of version 4, we can not access to DomAdapter outside Angular.

Seems like I'll need to develop and integrate it into Angular and make a PR. With the next release of Angular, the v0.4.x can use it (by enforcing that Angular version in peerDependencies) while the v0.2.x can do it internally (accessing the DomAdapter).

fulls1z3 avatar Apr 08 '17 16:04 fulls1z3

https://github.com/angular/angular/issues/15776#issuecomment-291862953

fulls1z3 avatar May 09 '17 08:05 fulls1z3