Using ng-repeat / ng-option expression in custom directive

ng-repeat and ng-select allow the user to pass X as X.Name in a select-style expression. I am wondering if this expression style can be used in a custom directive.

I looked at the angular source for ng-options and repeated, but I was unable to figure out exactly how they evaluate these attributes. If someone could point me to an example or documentation that would be much appreciated!

EDIT: Use case for angular typeahead component, I want to be able to pass in both primitive arrays and objects, change their display and also what is actually assigned to the ng model. This is also for my own knowledge if it ever becomes a requirement for use at work.

+3


source to share





All Articles