ngForce
ngForce copied to clipboard
vfr not defined
How come when I load ngforce and I go into the Chrome console and try using vfr functions that it says its not defined?
Vfr and the associated services are, just that: angular services. You’ll need to grab ahold of the service itself in order to use them from the console.
something like:
var vfr = angular.element('div[ng-app="pp"]').injector().get('vfr’)
where you modify the [ng-app=“pp”] selector to be the name of your app.
then you’ll be able to access vfr
-Pkj
-- Kevin Poorman Sent with Airmail
On January 9, 2015 at 11:37:47 AM, banderson5144 ([email protected]) wrote:
How come when I load ngforce and I go into the Chrome console and try using vfr functions that it says its not defined?
— Reply to this email directly or view it on GitHub.
I guess I'm just having a hard time doing a simple hello world (I.e. display a list of records). The examples that around the web are a little to advanced. Can you help me out with that.
So I figured out what my issue was. My Dev org has a namespace associated with it and you have your default Apex controller callout names hard coded (ngForceController.query). Is there a way to dynamically add a namespace?
I had the same issue where I needed a namespace.
Looking at the javascript source code, I did not see a way to dynamically add a namespace, so I ended up hardcoding it into the source code to keep the project moving forward. Basically a find/replace ngForceController to [namespace].ngForceController in the source.
Not a pretty solution, but enough to keep the project moving forward until a namespace feature is added.
Mogenshoj, have you been able to use the remote object library? Can't seem to get it
Yes, I was able to get both remote objects and vfr queries to work. Please provide more details or code.
I don't really have any code. Was just trying grab 10 accounts.
I was able to get all the other services working fine except remote objects
If you already created the remoteaction in a controller and return whatever you want to get out, I use something like this:
var request = vfr.send('[namespace].[controller].[action]', {}, false); request().then(function(result) { console.log(result) }, function(error) { console.log(error) });
Yeah I have done that. I am talking about remoteobjects. Not objects returned from remote action methods.
Oh right, I misunderstood. I haven't used the remote objects, only remote actions. So I can't help with that.
@banderson5144 are you still experiencing this issue?
I am still experiencing the issue for remote objects. Error message is "Unable to invoke action 'ngForceController.getPicklistValues': no controller and/or function found". My dev org has namespace and I don't want to hard code the script with namespace. Can you please help?