Description
Twigkit factory with methods for accessing the Twigkit API.Methods
cancelAllResponses()
Fires an event to cancel the current response being requested from the backend.Example
deleteBookmark(id)
Sends a request to delete a bookmark to the API.Parameters
Returns
Example
deleteComment(platform, id)
Sends a request to delete a comment to the API.Parameters
Returns
Example
deleteLike(platform, id)
Sends a request to delete a like to the API.Parameters
Returns
Example
deleteSavedQuery(id)
Sends a request to delete a saved query to the API.Parameters
Returns
Example
deleteTopic(id)
Sends a request to delete a topic to the API.Parameters
Returns
Example
getComments(platform, target, collection, topic)
Sends a request to get comments from the API.Parameters
Returns
Example
getConstant(defaultValue)
Gets a constant declared to the lightning module. A constant can be added to your application like so{{$root.myConstant}}
in your views.
Parameters
Returns
Example
getContextPath(defaultValue)
Gets the context path if it is available.Parameters
Returns
Example
getGraphFacet(query, platform, source-field, target-field, measure, measure-field)
Gets graph data for a facetParameters
Returns
Example
getLikes(options)
Sends a request to get a likes from the API.Parameters
Returns
Example
getUser()
Calls the Twigkit API to return the current user To enable this you need to make sure that your security.conf file contains the linewebservice-enabled: true
Your security.conf file can be found in ‘resources/conf/security/security.conf’.
For spring security you will need the following rule to allow access to the user api, if parts of the site are public.
<intercept-url pattern="/twigkit/api/user" access="isAnonymous() or isAuthenticated()"/>