0

Here is my code

how can i filter my dropdown directive using the custom attribute?

$scope.myKeyword = [
        {Id: 1, Keyword:"ActivityType", Description: "Active"}, 
        {Id: 2, Keyword:"ActivityType", Description: "InActive"}, 
        {Id: 3, Keyword:"ActivityType", Description: "Deleted"},
        {Id: 4, Keyword:"MarketSegment", Description: "Fashion"},
        {Id: 5, Keyword:"MarketSegment", Description: "IT"},
        {Id: 6, Keyword:"MarketSegment", Description: "F&B"},
        {Id: 7, Keyword:"MarketSegment", Description: "Manufacturing"},
    ];

directive tag

<keywords supplier-id="supplier.Id" keyword-type="MarketSegment"  title="Choose Status" label="" array="myKeyword" opt-value="Id" opt-description="Description"></keywords>

I want to filter the dropdown by MarketSegment provided.

1
  • 1
    I found the solution, just add filter:keywordType in the directive template. this is the update link Commented Sep 4, 2013 at 1:00

1 Answer 1

1

I found the solution, just add filter:keywordType in the directive template. this is the update link

<select ng-model="supplierId" ng-options="a[optValue] as a[optDescription] for a in array | filter: keywordType" required>'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.