Skip to content

Instantly share code, notes, and snippets.

@hhariri
Created June 7, 2013 21:49
Show Gist options
  • Save hhariri/5732657 to your computer and use it in GitHub Desktop.
Save hhariri/5732657 to your computer and use it in GitHub Desktop.
app.directive('projectLocator', function () {
return {
restrict: 'E',
scope: {
},
templateUrl: '/partials/projectLocator.html',
controller: function ($scope, $resource) {
$scope.selectd = undefined;
$scope.message = 'loading projects...';
$resource('/teamcity/projects').query(function (result) {
$scope.projects = result;
$scope.message = '';
});
}
};
});
<div class='container-fluid'>
<p>Go to Project</p>
<input type="text" value="{{message}}" ng-model="selected" typeahead="project.name for project in projects | filter: $viewValue">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment