Angular directives in example code

3 posts, 1 answers
  1. Nick
    Nick avatar
    6 posts
    Member since:
    Jun 2017

    Posted 13 Jul Link to this post

    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. Nick
    Nick avatar
    6 posts
    Member since:
    Jun 2017

    Posted 13 Jul in reply to Nick Link to this post

    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

  3. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    244 posts

    Posted 13 Jul Link to this post

    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.
Back to Top