Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit a652faf

Browse files
committed
Merge branch 'master' of github.com:ghiden/angucomplete-alt
2 parents 92905ad + 4c42540 commit a652faf

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ var app = angular.module('app', ["angucomplete-alt"]);
104104
| local-data | The local data variable to use from your controller. Should be an array of objects. [example](http://ghiden.github.io/angucomplete-alt/#example1) | No | countriesList |
105105
| search-fields | The fields from your local data to search on (comma separate them). Each field can contain dots for accessing nested attribute. [example](http://ghiden.github.io/angucomplete-alt/#example1) | No | title,description |
106106
| remote-url-request-formatter | A function that takes a query string and returns parameter(s) for GET. It should take the query string as argument and returns a key-value object. [example](http://ghiden.github.io/angucomplete-alt/#example5) | No | Suppose if you need to send a query keyword and a timestamp to search API, you can write a function like this in the parent scope. $scope.dataFormatFn = function(str) { return {q: str, timestamp: +new Date()}; } |
107+
| remote-url-request-with-credentials | A boolean that accepts parameters with credentials. | No | true or false |
107108
| remote-url-response-formatter | A function on the scope that will modify raw response from remote API before it is rendered in the drop-down. Useful for adding data that may not be available from the API. The specified function must return the object in the format that angucomplete understands. | No | addImageUrlToObject |
108109
| remote-url-error-callback | A callback funciton to handle error response from $http.get | No | httpErrorCallbackFn |
109110
| clear-selected | To clear out input field upon selecting an item, set this attribute to true. [example](http://ghiden.github.io/angucomplete-alt/#example3) | No | true |

angucomplete-alt.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
initialValue: '@',
7676
localData: '=',
7777
remoteUrlRequestFormatter: '=',
78+
remoteUrlRequestWithCredentials: '@',
7879
remoteUrlResponseFormatter: '=',
7980
remoteUrlErrorCallback: '=',
8081
id: '@',
@@ -429,6 +430,9 @@
429430
params = {params: scope.remoteUrlRequestFormatter(str)};
430431
url = scope.remoteUrl;
431432
}
433+
if (!!scope.remoteUrlRequestWithCredentials) {
434+
params.withCredentials = true;
435+
}
432436
cancelHttpRequest();
433437
httpCanceller = $q.defer();
434438
params.timeout = httpCanceller.promise;

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angucomplete-alt",
3-
"version": "0.0.36",
3+
"version": "0.0.37",
44
"homepage": "http://ghiden.github.io/angucomplete-alt/",
55
"authors": [
66
"Hidenari Nozaki <hidenari@gmail.com>"

0 commit comments

Comments
 (0)