这是indexloc提供的服务,不要输入任何密码
Skip to content
florianhoehn edited this page Dec 3, 2014 · 8 revisions

ngRemote

ngRemote is a tool for Visualforce to enable AngularJS to connect to the Salesforce.com backend via Visualforce RemoteObjects. For every Visualforce RemoteObject definition ngRemote creates an AngularJS service which allows CRUD functionality on the related Salesforce.com sObject.

ngRemoteObject component

attributes

name type required default description
remoteObjectNamespace String false SObjectModel js namespace defined in the apex:remoteObjects tag
remoteObjects String true names of all remoteObject for which services will be created - separated by comma (i.e. 'Account, Contact')
VisualforceVariables Boolean false false checked if Visualforce constant should be created so that the AngularJS app can access Visualforce components

ngRemoteObject AngularJS module

Example Service for Account that is created

AccountService {
  retrieve : function(options)
  retrieveById : function(recordId)
  retrieveByParentId : function(parentFieldName, recordId, numberOfRecords)
  retrieveRecentItems : function(numberOfRecords)
  create : function(record)
  update : function(record)
  del : function(recordId)
}