Skip to content
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

Angular directive issue ? #42

Closed
a45b opened this issue Nov 6, 2017 · 4 comments
Closed

Angular directive issue ? #42

a45b opened this issue Nov 6, 2017 · 4 comments

Comments

@a45b
Copy link

a45b commented Nov 6, 2017

this.parent = typeof parent === 'string' ? document.querySelector(parent) : parent;

I am trying to create Angular 2+ directive. As I have access to the element in the directive this.el.nativeElement, I want to use it as parent. But its not working. Only works when i set via attribute like id, class etc.

@pratu16x7
Copy link
Contributor

pratu16x7 commented Nov 6, 2017

@iamkdev That may be because we haven't yet published the dom element parent feature to npm yet, will be doing that in some time. #40

@achillesrasquinha
Copy link
Contributor

Hi @iamkdev, not an angular person here but do you think this is related to #2 ?

Ensuring you don't spend time while there comes an update.

@a45b
Copy link
Author

a45b commented Nov 6, 2017

Thanks for the awesome chart @pratu16x7.

@achillesrasquinha, the output of this.el.nativeElement and document.querySelector('#some-id') is same. i.e. <div id="some-id"></div>. I am not sure related to #2.

I want this to work . It should not coupled with id, class or other attribute. Because, in my angular directive I already have access to the element via this.el.nativeElement. So, why I use id! I should able to assign this.el.nativeElement to parent.

@pratu16x7
Copy link
Contributor

Published, updated docs, feel free to reopen in case of issues. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants