Skip to main content

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
You can then get this value in your controller and apply it to the scope or rootScope (if applied to the rootScope you can use {{$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 facet
Parameters
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 line webservice-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()"/>
Returns

Example

onCancelAllResponses(callback, scope)

When the cancel response event is fired the callback function will be called.
Parameters

Example

postLike(platform, id, target, topic, collection)

Sends a request to create a like to the API.
Parameters
Returns

Example

search(searchQuery, platform, params, ignore-loading-bar, canceller)

Search method sends a query to a Twigkit Platform endpoint and gets a result.
Parameters
Returns

Example

searchFacet(facet, platform, query, rpp, facetQuery, removeFilters, facetField, wildcard, canceller)

Calls the Twigkit API to return filters from a specific facet based on the searchQuery.
Parameters
Returns

Example

searchSeriesFacet(query, platform, facet, measure, rpp)

Gets series data for a facet.
Parameters
Returns

Example

searchSeriesFields(query, platform, fields, rpp)

Gets series data for a result list.
Parameters
Returns

Example