This is a migrated thread and some comments may be shown as answers.

Angular directives in example code

2 Answers 94 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nick
Top achievements
Rank 1
Nick asked on 13 Jul 2017, 06:15 AM

What is the significance of the tkToggleNavButton and tkExampleHeader directives that show up in the example code? These directives don't show up in the API doc.

2 Answers, 1 is accepted

Sort by
0
Nick
Top achievements
Rank 1
answered on 13 Jul 2017, 06:43 AM

Nevermind. I see that these are defined in the actual sample application:

https://github.com/telerik/nativescript-ui-samples-angular/tree/release/sdkAngular/app/navigation/directives

0
Accepted
Nikolay Tsonev
Telerik team
answered on 13 Jul 2017, 06:55 AM
Hello Nick,

Those two custom directives have been created for the needs of the sample application. tkToggleNavButton is custom Angular 2 directive, which allows reusing the same logic for the Navigation Back button, without the need to write the same code for every example. The same case is also for tkExampleHeader which is responsible for setting up the correct title in the ActionBar. The definitions for those directives could be found here.

Bear in mind that creating custom directives technic is  related to Angular 2. Regarding that, there is nothing special on them and you could simply ignore them. In case you need to create your own custom directive you could review this article in the Angular 2 documentation and the example here.

Hope this helps.
Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
General Discussion
Asked by
Nick
Top achievements
Rank 1
Answers by
Nick
Top achievements
Rank 1
Nikolay Tsonev
Telerik team
Share this question
or