-
Notifications
You must be signed in to change notification settings - Fork 97
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
ol.control implementation #45
Comments
With a wrapper for the
|
About the subclassing of ol.control classes : you're right. We moved away from this design in every other component but I haven't found the time to change the controls yet. Regarding the transclusion and the wrapper solution, I'm not sure I understand what you're trying to achieve. Could you provide an example so I understand what's at stake and come back with meaningful ideas ? |
My (rather big now) PR has the control reimplementation included. With the control class copied above, I can do this:
The only problem I see is that I get an additional wrapper |
Hmm, I'm not a fan of the wrapper div solution either. Have you tried passing the ElementRef to the component constructor and then accessing the transcluded content like this ? constructor(
@Host() private map: MapComponent,
private element: ElementRef
) {
}
[...]
this.element.nativeElement.childNodes[0] |
Actually this works as well. Thanks! |
Came up with another issue with this approach (taking the first child). I created a an implementation of
The approach taken is to get an |
What about enumerating children until we get the first one that does not start with |
;)
We could also make use of HTML element IDs (#ugly) or CSS classes but that's .notpretty.
We could also enforce a "unique child" policy but that feels wrong (especially the name :/)
Puns aside, I believe we should do multiple-slots content projection and write an "aol-content" directive (not component) to discriminate the content from the rest.
Opinions?
Interesting read on transclusion/projection:
https://toddmotto.com/transclusion-in-angular-2-with-ng-content
-------- Message d'origine --------
De : Achim Hasenmueller <notifications@github.com>
Date : 13/02/2017 18:48 (GMT+01:00)
À : quentin-ol/angular2-openlayers <angular2-openlayers@noreply.github.com>
Cc : Subscribed <subscribed@noreply.github.com>
Objet : Re: [quentin-ol/angular2-openlayers] ol.control implementation (#45)
What about enumerating children until we get the first one that does not start with aol-? Uglier? Less ugly? 😄
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#45 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AOYyYuVFLHpqIjJIuJDa3a6SEa9znMM5ks5rcJd2gaJpZM4L-LHJ>.
…_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
|
I like the |
Implemented and documented as part of my latest PR. |
I started looking into the unfinished control implementations.
There are a few questions. First of all, I don't think you can derive the classes from the OL classes as this breaks the
@Input()
parameter setting. So I changed it to theinstance
method used elsewhere. Next, the question is whether to use transclusion with<ng-content>
. I couldn't get it to work so I went for this solution which uses the component's DOM element:In order to style it, you will need the piercing CSS selector (
:host /deep/
) which is probably OK. Any thoughts on how to do the controls implementation?The text was updated successfully, but these errors were encountered: