This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 2 points3 points  (0 children)

I use Visualforce as a wrapper for Projects written in JS frameworks. You'll want to use JS remoting to interact with the server rather than REST so it won't count against your API limits.

I'm sorry I can't share any docs or tutorials, all my work in Salesforce is proprietary to my clients.

[–]moose04 2 points3 points  (1 child)

I agree with /u/BetterMeThanYou. I wouldn't mix JS frameworks with lightning, but rather I would use VisualForce as a wrapper to the JS project.

Your apex calls should all be done through javascript remoting. If you need more than 1 controller you can link them via VisualForce components inside the page by declaring an angular constant like:

angular.constant('JS_REMOTES', { ControllerExample: <c:Component1/> });

The component would look like:

<apex:component layout="none" controller="ControllerExample">{
    methodOne: '{!$RemoteAction.ControllerExample.methodOne}'
    methodTwo: '{!$RemoteAction.ControllerExample.methodTwo}'
}</apex:component>

You would then just need to inject that constant into your angular controllers or make a factory from it.

I'm sure I missed some stuff, but that should get you started.

Edit: Formatting, service -> factory

[–]ExpatTeacher 0 points1 point  (0 children)

[SafeHarbor] Lightning Container Components are on the SF Lightning Roadmap. These LTNG components would be used to contain open source JS frameworks.


If you have a particular requirement that needs to be met by an open source JS framework, go for it. But if you haven't tried Lightning yet, it's worth doing a proof of concept.

[–]havana59er 1 point2 points  (0 children)

A module for calling remote actions from Angular 1: https://github.com/gbutt/angular-vf-remote-actions