How to prevent duplicates in repeated options in select
Hello ! I am trying to filter my repeated list using a select element . I want the options in the select to be dynamically rendered from an enum with predefined options . How do I make the enum options not displayed more than once in the select element even if they appear multiple times in the database ? I tried using the unique ( ) formula in different ways but I couldn 't get it to work correctly . So first Map . Unique works by checking the whole object , so if the data from your database has some unique ID etc . it won 't work I kind of have a follow -up problem . After creating the select and rendering the options correctly thanks to @Jacob Kofoed , I am trying to filter a list based on the option selected in the select element . So I created a variable with an empty string " "to hold the value and add a 'change ' event . But no matter which options I select , the variable only shows "option1 " . Here are some screen shots . @Jacob Kofoed or anyone , what did I do wrong ? You 'll see a value attribute in there , go in and make sure it is the 'item ' you are repeating over Seems like you did everything correctly though ✌️







.jpeg/public)