Create or use plugins in Angular


#1

Hi,

I would like to dev some plugins or contribute to some that I need for my NativeScript + Angular app but I’m struggling to find some advanced tutorials or ressources to get help. For examples:

Those who are complete are for non-complex work, and those who have not much content/examples are for complex work.

I also struggle to use nativescript plugins coded in TypeScript with Angular2, for example this one:

BottomNavigation

I tried it in a non angular app and it works great, but i didnt manage to use it in an Angular app, even after dev a Directive based on examples found on issues, Stackoferflow etc… The problem is that i’m never getting any erros… so it’s even more hard.

If someone has some ressources/tutorials/sample-projects to share to help me out I would be grateful :grinning:

Cheers from France


#2

hi, bonjour!

I know how you feel! Plugin dev can be hard. One resource coming soon (in March?) is Nathan Walker’s brilliant course on just this topic on Egghead.io. @wwwalkerrun <- want to tell us more?


#3

Hey, @rhanb, ça va? haha

I guess typescript plugins should work fine in NS + NG2 apps as long as you register the element. I’ve seen you checked the third party libraries tutorial, but just to make sure, have you added something like this to your code?

import {registerElement} from "nativescript-angular/element-registry";
registerElement("BottomNavigation", () => require("nativescript-bottomnavigation").BottomNavigation);
registerElement("BottomNavigationItem", () => require("nativescript-bottomnavigation").BottomNavigationItem);

If you did this and didn’t work, could you provide us some more information? Such as an example code or something.

Cheers from Brazil =)


#4

For creating your own plugins, many folks have also started with Nathan’s plugin seed: https://github.com/NathanWalker/nativescript-plugin-seed

Check out the plugins already built at http://plugins.nativescript.org for more inspiration and help.


#5

Hi , está tudo bem e você?

You can find a sample project right here

(I let the App_Ressources to let you have the icons needed out of the box)

Thank you for your answer :slight_smile:


#6

Thanks @jen.looper yes @rhanb here’s a sample of the topics I will be covering:

  • Prepare your NativeScript for Angular project for Objective C/Swift and Java intellisense support via TypeScript definitions

  • Use an Objective C library in a NativeScript for Angular iOS app

  • How to use Objective C Delegates in NativeScript for Angular iOS apps

  • Generate metadata TypeScript declarations for Objective C libraries

  • Use a Java library in a NativeScript for Angular Android app

  • Go deeper with Java in NativeScript for Angular Android apps

  • Develop a consistent plugin api across your Android and iOS NativeScript app

  • Use Swift in a NativeScript for Angular iOS app

  • Build a custom NativeScript view component for iOS based on a CocoaPod

  • Go deeper with custom UIViewController in NativeScript for Angular iOS app

  • Build a custom NativeScript view component for Android based on an Android Arsenal lib

  • Develop a public NativeScript plugin using the nativescript-plugin-seed

  • Conditionally require a NativeScript plugin when only 1 platform is supported

Lemme know if there are any other specific topics you would like to see covered.


#7

Thanks @wwwalkerrun and @jen.looper !

Looks great looking forward to see that ! I don’t see other specifics topics about plugins right now, but if I think about one I will give you a shoutout on this topics


#8

Hi @wwwalkerrun,

I watched your course and it’s pretty great, it’s simple but complete ! Many thanks :grin: