1

I recently start playing with Nativescript (angular) and I wanted to import a video player plugin. Everything worked great however I was a little confused with the code they used in demo which lead me to this page: Integrating UI components with Angular https://docs.nativescript.org/plugins/angular-third-party

Following the example provided

import {registerElement} from "nativescript-angular/element-registry";
registerElement("third-party-view", () => require("./third-party-view").SimpleTag);

and then use third-party-view in your template <third-party-view prop1="value1"></third-party-view> got me thinking why do you need to use registerElement instead of importing the component from an Angular module? After all that is the Angular way of doing things, or am I missing something?

1 Answer 1

2

Not all the plugins are Angular compatible. If the author of a plugin supports Angular, he would have written the appropriate Angular module which you will just import. Register element is an alternative when the plugin doesn't impelement Angular module out of box.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.