Custom component/module for Nativescript Core


#1

Hi guys, I am trying to create custom components/modules (I don’t know how its called) to use on my NativeScript Core apps, in Angular I used to use them like this:

<MyCustomComponent [value]="_value" (onChange)=onChange"></MyCustomComponent>

I am trying to create a custom framework so I can reuse on my apps and customize them.

Is there any documentation to follow?

Thanks!


#2

Are you asking about using the Angular component in Core?


#3

Hey @manojdcoder, I want to be able to create custom components in Core.


#4

Did you refer this section in the docs.


#5

That is exactly what I am looking for, but now I am trying to pass data to that custom component and set events. I want to be able to do something like this:

<Page xmlns:customControls="components/my-control" navigatingTo="navigatingTo" class="page">
    <customControls:MyControl value="This is my custom value" onSubmit="{{ onSubmit }}" />
</Page>

I do not see how to accomplish this in the documentation…

Any idea?

Thanks!


#6

You have everything in docs, you just have to follow the getting started guide step by step for best learning experience.

https://docs.nativescript.org/core-concepts/events#creating-a-custom-event