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 2.0.0-rc.1 no longer exports BrowserDomAdapter #8509
Comments
Could you just implement |
Dealing with this issue myself. Where is DomAdapter? I've used BrowserDomAdapter a lot because everything said to use it. |
I spoke to soon, The disappearing |
Martin can you please also check AnimationBuilder, it seems this has also been removed. The below line doesn't work anymore: import {AnimationBuilder} from 'angular2/src/animate/animation_builder'; |
@naveedahmed1 |
Ok, thank you Martin for the information. It seems currently the beta 17 is more stable than RC1. |
Are there any reasons to use |
@Falx |
@mprobst Ok thanks, because I removed |
So is using document fine then? I thought we encouraged to not use it in favor of browserdomadapter |
DomAdapter, BrowserDomAdapter and Parse5DomAdapter are just implementation details and should not be used as public apis. This is why you can't find it any more in the public api surface. If you need access to document then you can inject it via the |
@IgorMinar any pointer how to create and provide a custom renderer for different platforms (browser, webworker, server, ...) |
@IgorMinar I was using |
@Elvynia it's in the private API only because it is not supposed to be used outside Angular itself. |
@zoechi Sure I get it. I'm calling |
@Elvynia nope, |
@mprobst AFAIK this is necessary for custom code to be compatible with server side rendering and webworker.
It would be great if someone could point out how to implement and provide a custom renderer. |
@IgorMinar When trying to use DOCUMENT it says cannot find name DOCUMENT. How exactly is it supposed to be used to replace what BrowserDomAdapter accomplished? Stackoverflow and articles on previous version of Angular 2 have been riddled with advice of using BrowserDomAdapter and it's hard to find the proper way to do the alternatives. |
this should do the trick:
On Wed, Jun 8, 2016 at 11:58 AM twilliamsgsnetx notifications@github.com
|
@twilliamsgsnetx So I had the same problem as you. This is how I figured it out (since documentation is not complete yet). As you can see here: DOCUMENT is an OpaqueToken. I searched for that concept and found out that it is a mechanism to have a handle to inject something that you would normally name with a String. Since if you have multiples of that, they all have the same type (String) and DI would not be able to deduce which provider to use for that type.
|
Ah it seems @IgorMinar beat me to it ;-P |
@zoechi Did you get answer for your question? Tho you can access I was trying to get the computed value of a native element using Does anyone know any better solution other than accessing window directly? I have posted the question here |
@IgorMinar What's the way to access the
doesn't work. A custom renderer is needed? TIA |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Prior to Angular 2.0.0-rc.0, it was possible to import and use BrowserDomAdapter in the application. Seems like it is no longer exported from @angular/platform-browser. Is this intentional or a bug?
Originally, I asked the question on StackOverflow: http://stackoverflow.com/questions/37068937/accessing-dom-in-angular-2-rc
Is there an API that should be used instead?
The text was updated successfully, but these errors were encountered: