0

I have 2 select directives:

 <select ng-model="selectedDistrict" ng-options="item.DISTRICT as item.DISTRICT for item in opendata  | unique: 'DISTRICT' "></select>
    <select ng-model="selectedYear" ng-options="item as item.YEAR for item in opendata | filter:{ DISTRICT: {{selectedDistrict}} }"></select>

The problem is that the second one gives error: Error: [$parse:syntax] Syntax Error: Token '}' not a primary expression at column 32 of the expression [opendata | filter:{ DISTRICT: }] starting at [}]

It is because selectedDistrict is not yet populated owing to the large size of opendata.

Is there a callback so that second directive can be fired once the first one has got the value?

1 Answer 1

3

It is because selectedDistrict is not yet populated owing to the large size of opendata.

No, it is because you're using wonky syntax.

The correct syntax would be:

item as item.YEAR for item in opendata | filter: { DISTRICT: selectedDistrict }
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.