Javascript Angular 5 在某些类中添加了“ng-star-inserted”——那是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47792932/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 03:56:52  来源:igfitidea点击:

Angular 5 adds 'ng-star-inserted' in some classes - what is that?

javascriptcssangularangular-template

提问by vzR

I'm seeing that among the classes added to an element, sometimes there's this 'ng-star-inserted' added as well and I'd like to know more as to why is it there?

我看到在添加到元素的类中,有时还会添加这个“ng-star-inserted”,我想知道更多关于它为什么存在的信息?

回答by Ben Elliott

It's a class name that is used internally by the BrowserAnimationsModulewhen animating entry and leaving transitions. You can see it in the source code here.

它是一个类名,BrowserAnimationsModule在动画进入和离开过渡时在内部使用。您可以在此处的源代码中看到它。

回答by eliprodigy

This class cause problem with the UI so need to replace with a <ng-container *ngIf=""></ng-container>

此类会导致 UI 出现问题,因此需要替换为 <ng-container *ngIf=""></ng-container>