NathanaelA / nativescript-dom

NativeScript DOM emulation methods
MIT License
42 stars 23 forks source link

Nativescript Angular guide #18

Closed seveneye closed 5 years ago

seveneye commented 5 years ago

Hi @NathanaelA , do you have guide for nativescript + angular. As stated in the note, you only need to load it once. Does it mean that I only import it in the app component of an angular app?

carolgit commented 5 years ago

Any answer for @seveneye question?

NathanaelA commented 5 years ago

Yes, you just need to load it once in the app during startup and it will bind to the NativeScript components. However, in Angular; NS-Dom might not be really needed or recommended.
First, you can access the elements using standard angular calls. Second If you use NS-Dom, you will get the NativeScript element; and not the angular element.

NativeScript-Angular is layered like so:

In a lot of cases this isn't a problem, but I wanted to make sure you are aware of this...
NS-Dom, only looks for the NativeScript elements; so it will return what you would get when you did angularElement.nativeElement