Are you sure the problem is caused by the ng-if directive? I built an example and didn't find any problems, and I didn't encounter any delays during development.
Test address: https://jsfiddle.net/mm0h7ves/
There is no reason to have delays in the UI, unless your script execution efficiency is too low or there are too many watchers on the page, causing the polling dirty check to be too slow
Are you sure the problem is caused by the ng-if directive? I built an example and didn't find any problems, and I didn't encounter any delays during development.
Test address: https://jsfiddle.net/mm0h7ves/
There is no reason to have delays in the UI, unless your script execution efficiency is too low or there are too many watchers on the page, causing the polling dirty check to be too slow
This is very simple. Before clicking to switch, just set the object output by the previous p to empty