Skip to main content

Description

The saved query list directive to render a list of saved queries

Usage

as element:
<collaborate:saved-query-list
       user="{object}"
       [title="{string}"]
       [allow-saving="{string}"]
       [date-format="{string}"]>
</collaborate:saved-query-list>

Directive info

  • This directive creates new scope.

Parameters

ParamTypeDetails
userobjectDisplay saved queries by the given user (type: twigkit.social.model.Profile).
title (optional)stringIf set, title will be used displayed above bookmarks
allow-saving (optional)stringIf set to false the save search input will not be shown
date-format (optional)stringFormat to use for the saved query created date. Default: dd/MM/yyyy h:mma. See date format filter for valid formats.

Events

savedQueryAdded

When a query is saved this event broadcast with the name of the query being saved, the URL being used and the topic if used.
angular.module('twigkitLightApp')
.controller('MainCtrl', ['$scope', function ($scope) {
     $scope.$on('savedQueryAdded',function(query){
          alert('Query - ' + query.name + ' have been saved.');
     });
}]);

Type:

broadcast

Target:

root scope

savedQueryDeleted

When a query is deleted this event is broadcast so that any custom alerts or functions can be run afterwards like the example below.
angular.module('twigkitLightApp')
.controller('MainCtrl', ['$scope', function ($scope) {
     $scope.$on('savedQueryDeleted',function(){
         alert('Query has been deleted.');
     });
}]);

Type:

broadcast

Target:

root scope