{"id":202654,"date":"2023-10-08T16:08:10","date_gmt":"2023-10-08T16:08:10","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/"},"modified":"2023-10-08T16:08:10","modified_gmt":"2023-10-08T16:08:10","slug":"how-to-get-the-previous-selected-value-in-dropdown-in-angular","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/","title":{"rendered":"How to get the previous selected value in dropdown in Angular?"},"content":{"rendered":"<p>When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform validation, trigger certain actions, or simply display the previously selected value, knowing how to access this information is crucial. In this article, we will discuss how to get the previous selected value in a dropdown in Angular.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#Answer\" title=\"Answer:\">Answer:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#1_How_can_I_access_the_current_selected_value_in_Angular_dropdown\" title=\"1. How can I access the current selected value in Angular dropdown?\">1. How can I access the current selected value in Angular dropdown?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#2_Is_it_possible_to_track_the_changes_in_a_dropdown_selection_in_Angular\" title=\"2. Is it possible to track the changes in a dropdown selection in Angular?\">2. Is it possible to track the changes in a dropdown selection in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#3_Can_I_display_the_previous_selected_value_in_a_dropdown_in_Angular\" title=\"3. Can I display the previous selected value in a dropdown in Angular?\">3. Can I display the previous selected value in a dropdown in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#4_What_is_the_benefit_of_getting_the_previous_selected_value_in_a_dropdown_in_Angular\" title=\"4. What is the benefit of getting the previous selected value in a dropdown in Angular?\">4. What is the benefit of getting the previous selected value in a dropdown in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#5_How_does_the_ngModelChange_event_work_in_Angular\" title=\"5. How does the ngModelChange event work in Angular?\">5. How does the ngModelChange event work in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#6_Can_I_use_ngModelChange_with_dropdowns_in_Angular\" title=\"6. Can I use ngModelChange with dropdowns in Angular?\">6. Can I use ngModelChange with dropdowns in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#7_Is_it_possible_to_track_the_previous_selected_value_without_using_ngModelChange_in_Angular\" title=\"7. Is it possible to track the previous selected value without using ngModelChange in Angular?\">7. Is it possible to track the previous selected value without using ngModelChange in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#8_How_can_I_reset_the_dropdown_selection_to_the_previous_value_in_Angular\" title=\"8. How can I reset the dropdown selection to the previous value in Angular?\">8. How can I reset the dropdown selection to the previous value in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#9_Are_there_any_built-in_Angular_features_for_handling_previous_selected_values_in_dropdowns\" title=\"9. Are there any built-in Angular features for handling previous selected values in dropdowns?\">9. Are there any built-in Angular features for handling previous selected values in dropdowns?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#10_Can_I_use_Angular_Forms_to_manage_previous_selected_values_in_dropdowns\" title=\"10. Can I use Angular Forms to manage previous selected values in dropdowns?\">10. Can I use Angular Forms to manage previous selected values in dropdowns?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#11_How_can_I_prevent_the_previous_selected_value_from_being_overwritten_in_a_dropdown_in_Angular\" title=\"11. How can I prevent the previous selected value from being overwritten in a dropdown in Angular?\">11. How can I prevent the previous selected value from being overwritten in a dropdown in Angular?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#12_Is_it_possible_to_store_multiple_previous_selected_values_in_dropdowns_in_Angular\" title=\"12. Is it possible to store multiple previous selected values in dropdowns in Angular?\">12. Is it possible to store multiple previous selected values in dropdowns in Angular?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Answer\"><\/span>Answer:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><\/p>\n<p><strong>To get the previous selected value in a dropdown in Angular, you can use the ngModelChange event along with a local variable to store the previous value. Here&#8217;s how you can do it:<\/strong><\/p>\n<p>&#8220;`html<br \/>\n<select [(ngModel)]=\"selectedValue\" (ngModelChange)=\"onValueChange($event)\"><br \/><option *ngFor=\"let option of options\" [value]=\"option.value\">{{option.label}}<\/option><br \/>\n<\/select><br \/>\n&#8220;`<\/p>\n<p>&#8220;`typescript<br \/>\npreviousValue: any;<\/p>\n<p>onValueChange(newValue: any) {<br \/>\n  \/\/ Store the previous value<br \/>\n  this.previousValue = this.selectedValue;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>By utilizing the ngModelChange event and a local variable to store the previous value, you can easily access the previous selected value in a dropdown in Angular.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_How_can_I_access_the_current_selected_value_in_Angular_dropdown\"><\/span>1. How can I access the current selected value in Angular dropdown?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>To access the current selected value in an Angular dropdown, you can use ngModel with two-way binding to bind the selected value to a variable in your component.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Is_it_possible_to_track_the_changes_in_a_dropdown_selection_in_Angular\"><\/span>2. Is it possible to track the changes in a dropdown selection in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can track the changes in a dropdown selection in Angular by using the ngModelChange event that is triggered whenever the selected value changes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Can_I_display_the_previous_selected_value_in_a_dropdown_in_Angular\"><\/span>3. Can I display the previous selected value in a dropdown in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can display the previous selected value in a dropdown in Angular by storing the previous value in a local variable and then accessing it where needed.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_What_is_the_benefit_of_getting_the_previous_selected_value_in_a_dropdown_in_Angular\"><\/span>4. What is the benefit of getting the previous selected value in a dropdown in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Getting the previous selected value in a dropdown in Angular can be useful for performing actions based on the previous selection, implementing validation logic, or displaying the previously selected value to the user.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_How_does_the_ngModelChange_event_work_in_Angular\"><\/span>5. How does the ngModelChange event work in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>The ngModelChange event in Angular is triggered whenever the value bound to ngModel changes, allowing you to perform actions or track the changes in the selected value.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Can_I_use_ngModelChange_with_dropdowns_in_Angular\"><\/span>6. Can I use ngModelChange with dropdowns in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can use the ngModelChange event with dropdowns in Angular to track changes in the selected value and perform actions based on those changes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_Is_it_possible_to_track_the_previous_selected_value_without_using_ngModelChange_in_Angular\"><\/span>7. Is it possible to track the previous selected value without using ngModelChange in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>While ngModelChange is a common approach to track changes in the selected value, you can also implement custom logic to store and access the previous selected value without using this event.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_How_can_I_reset_the_dropdown_selection_to_the_previous_value_in_Angular\"><\/span>8. How can I reset the dropdown selection to the previous value in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>To reset the dropdown selection to the previous value in Angular, you can simply set the selected value back to the previous value stored in a local variable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_Are_there_any_built-in_Angular_features_for_handling_previous_selected_values_in_dropdowns\"><\/span>9. Are there any built-in Angular features for handling previous selected values in dropdowns?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Angular provides ngModel for two-way data binding, which can be utilized along with custom logic to handle previous selected values in dropdowns.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_Can_I_use_Angular_Forms_to_manage_previous_selected_values_in_dropdowns\"><\/span>10. Can I use Angular Forms to manage previous selected values in dropdowns?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can use Angular Forms along with ngModel to manage previous selected values in dropdowns and implement validation and logic based on those values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_How_can_I_prevent_the_previous_selected_value_from_being_overwritten_in_a_dropdown_in_Angular\"><\/span>11. How can I prevent the previous selected value from being overwritten in a dropdown in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>To prevent the previous selected value from being overwritten in a dropdown in Angular, you can store the previous value in a separate variable and only update it when needed, without modifying the selected value directly.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_Is_it_possible_to_store_multiple_previous_selected_values_in_dropdowns_in_Angular\"><\/span>12. Is it possible to store multiple previous selected values in dropdowns in Angular?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can store multiple previous selected values in dropdowns in Angular by using an array or object to keep track of the previous values for different dropdowns or selections.<\/p>\n<p>By following the steps outlined above and using the ngModelChange event along with a local variable to store the previous value, you can easily access the previous selected value in a dropdown in Angular. This enables you to perform various actions based on the previous selection and enhance the functionality of your dropdown components.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform validation, trigger certain actions, or simply display the previously selected value, knowing how to access this information is crucial. In this article, we will discuss how to get the previous selected &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to get the previous selected value in dropdown in Angular?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#more-202654\">Read more<span class=\"screen-reader-text\">How to get the previous selected value in dropdown in Angular?<\/span><\/a><\/p>\n","protected":false},"author":51,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-202654","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get the previous selected value in dropdown in Angular?<\/title>\n<meta name=\"description\" content=\"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get the previous selected value in dropdown in Angular?\" \/>\n<meta property=\"og:description\" content=\"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-08T16:08:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Adam Forbes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adam Forbes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\"},\"author\":{\"name\":\"Adam Forbes\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/88cd882dfb29a6b147bc0ea26dc84060\"},\"headline\":\"How to get the previous selected value in dropdown in Angular?\",\"datePublished\":\"2023-10-08T16:08:10+00:00\",\"dateModified\":\"2023-10-08T16:08:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\"},\"wordCount\":690,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\",\"name\":\"How to get the previous selected value in dropdown in Angular?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2023-10-08T16:08:10+00:00\",\"dateModified\":\"2023-10-08T16:08:10+00:00\",\"description\":\"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get the previous selected value in dropdown in Angular?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/88cd882dfb29a6b147bc0ea26dc84060\",\"name\":\"Adam Forbes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Adam Forbes\"},\"description\":\"Guest author Adam Forbes has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get the previous selected value in dropdown in Angular?","description":"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/","og_locale":"en_US","og_type":"article","og_title":"How to get the previous selected value in dropdown in Angular?","og_description":"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform","og_url":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2023-10-08T16:08:10+00:00","og_image":[{"width":500,"height":164,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","type":"image\/png"}],"author":"Adam Forbes","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Adam Forbes","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/"},"author":{"name":"Adam Forbes","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/88cd882dfb29a6b147bc0ea26dc84060"},"headline":"How to get the previous selected value in dropdown in Angular?","datePublished":"2023-10-08T16:08:10+00:00","dateModified":"2023-10-08T16:08:10+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/"},"wordCount":690,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/","url":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/","name":"How to get the previous selected value in dropdown in Angular?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2023-10-08T16:08:10+00:00","dateModified":"2023-10-08T16:08:10+00:00","description":"When working with dropdowns in Angular, it can be important to track the previous selected value for various reasons. Whether you need to perform","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-the-previous-selected-value-in-dropdown-in-angular\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to get the previous selected value in dropdown in Angular?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/88cd882dfb29a6b147bc0ea26dc84060","name":"Adam Forbes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Adam Forbes"},"description":"Guest author Adam Forbes has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/202654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=202654"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/202654\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=202654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=202654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=202654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}