Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Jeavon/f621b1a3323f05c25891 to your computer and use it in GitHub Desktop.
Save Jeavon/f621b1a3323f05c25891 to your computer and use it in GitHub Desktop.
Getting filesystem nuPickers working
angular
.module('umbraco')
.controller("nuPickers.Shared.TypeaheadListPicker.TypeaheadListPickerEditorController",
['$scope',
function ($scope) {
alert('hi');
//$scope.clear = function () {
// $scope.typeahead = null;
// $scope.selectableOptions = null;
//};
// setup a watch on the input
$scope.$watch('typeahead', function (newValue, oldValue) {
if (newValue != null && newValue.length >= $scope.model.config.typeaheadListPicker.minCharacters) {
$scope.getEditorOptions(newValue).then(function (response) {
if (response.data.length > 0) {
$scope.selectableOptions = response.data;
}
else {
$scope.typeahead = oldValue;
}
});
}
else {
$scope.selectableOptions = [];
}
});
if ($scope.model.config.typeaheadListPicker.limitTo > 0) {
$scope.$watchCollection('selectableOptions', function () {
$scope.selectableOptions = $scope.selectableOptions.slice(0, $scope.model.config.typeaheadListPicker.limitTo);
});
}
}]);
<remove fileExtension=".js.nu" />
<mimeMap fileExtension=".js.nu" mimeType="text/javascript" />
<remove fileExtension=".css.nu" />
<mimeMap fileExtension=".css.nu" mimeType="text/css" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment