When trying to dynamically create a reactive form to render the admiralty-select component, we have an issue where it returns an error of NG0100 which can be seen below:
Here is the HTML specific to the design system component but using the disableOption method:
As you can see the 2 different methods cause the issue when returning back to the component regardless of whether or not you destroy the component. The issue lies between the "Current Value" and the "Old Value" changing after the content is rendered, when using the "admiralty-select". So in both methods we have both the current value and old value, whether it be (true changing false) or (an array of 10 changing to an array of 5).
The only way I managed to supress the error was implementing the following, however its not best practice to do this as it takes a big performance hit (literally being called at every change not matter how big or small - even when you take it out of the subscribe, which I implemented to limit the times it was called):
When trying to dynamically create a reactive form to render the
admiralty-select
component, we have an issue where it returns an error of NG0100 which can be seen below:Here is the HTML specific to the design system component but using the disableOption method:
Here is the HTML specific to the design system component by using the getAvailableMethodsOfSurvey(index) method to mutate the data using rxjs:
As you can see the 2 different methods cause the issue when returning back to the component regardless of whether or not you destroy the component. The issue lies between the "Current Value" and the "Old Value" changing after the content is rendered, when using the "admiralty-select". So in both methods we have both the current value and old value, whether it be (true changing false) or (an array of 10 changing to an array of 5).
The only way I managed to supress the error was implementing the following, however its not best practice to do this as it takes a big performance hit (literally being called at every change not matter how big or small - even when you take it out of the subscribe, which I implemented to limit the times it was called):
When I removed this admiralty-select component and used a standard select component we have no issues or errors, with either of the 2 methods.
We need the admiralty-select component to be able to handle changes without modifying the changeDetection strategy or using the detectChanges method.