Are SDK for Web APIs supported in >=Angular 2 applications.
Hello,
Are SDK for Web APIs supported in >=Angular 2 applications.
If it is supported, what is the best way to import "loader-sdk.min.js" and "rainbow-sdk.min.js" files available inside rainbow-web-sdk folder into my angular 2/4 projects. My requirement is to call all the API functions inside .ts component file.
Regards,
Sunny
-
Hi Sunny Singh,
To answer the main question- yes, SDK for Web is supported in Angular 2+ applications.
In order to import the Rainbow SDK files, download a Starter Kit for Angular 2 from our GitHub repository (https://github.com/Rainbow-CPaaS/StarterKit-SDKWeb-Angular2) and follow the instructions from the README.md file.Once you've set up your project, you're ready to go.
In order to use the APIs inside of your component .ts files, you need to add the given function to the sdk class (in /src/modules/sdk.ts) and then import it into your component.
This approach works also with the latest version of Angular (Angular 7).
Should you have any questions, do not hesitate to contact us.
Please sign in to leave a comment.
Comments
3 comments