我调试我的程序并添加一个断点.停止后,我想检查一些变量,有时得到一个com.sun.jdi.ObjectCollectedException.在不同来源搜索后,我发现很可能这个对象是G arbage C ollected.单击此处和那里我可以检索我的对象,但在Variables视图中我无法检查变量.
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Xms512m
-Xmx4096m
--add-modules=ALL-SYSTEM
Run Code Online (Sandbox Code Playgroud)
我使用OpenJDK 1.8.0_151在Linux/OpenSuSe下运行.任何提示如何避免这种GC问题?这是IDE中的某种设置吗?
我希望有一个LoginForm,并在此用户输入应用程序后 - 使用德语或英语.据我所知,我可以设置app.module.ts类似的东西
import { LOCALE_ID } from '@angular/core';
providers: [{ provide: LOCALE_ID, useValue: 'de-DE' },...]
Run Code Online (Sandbox Code Playgroud)
但那是在启动时,而不是在LoginForm已经显示的时候: - /有没有办法改变整个应用程序的语言环境?(不仅仅是针对特定组件!) - 如果翻译可以随时更改,那将会很棒.任何提示如何实现?我只找到了上面的处理方式.
我strictTemplates:true在 HTML 模板中设置并使用了以下内容
<textarea matInput matAutosizeMaxRows="4" matTextareaAutosize="true"
Run Code Online (Sandbox Code Playgroud)
我从编译器收到
 error TS2322: Type 'string' is not assignable to type 'number'.
 error TS2322: Type 'string' is not assignable to type 'boolean'.
Run Code Online (Sandbox Code Playgroud)
但是如何在 HTML 模板中正确设置它(以避免错误)?
我有一个像 HTML 字符串
 <span class="diff-html-changed" id="1" changes="MyText" >test </span>
Run Code Online (Sandbox Code Playgroud)
我想将文本显示为 html。我把它包括在内
displayedContentInTemplate: SafeHtml;
private sanitized: DomSanitizer,
....
displayedContentInTemplate = this.sanitized.bypassSecurityTrustHtml(contentAsString);
Run Code Online (Sandbox Code Playgroud)
我的问题是changes没有显示的内容。因此我想重命名changes为title. 这将MyText在悬停文本时显示。
如何changes正确更改属性?字符串中的简单替换可能会替换属于显示文本的文本。通过简单地创建 HTML 文档,我不知道如何更改属性名称。
我知道这可能是一个简单的问题,但我没有找到答案:-/
我在 SPA 中多次阅读加载数据的“模板”一词。“模板”是否只是填充数据的常规视图?或者有什么区别,它们是否重叠?
我以为可以将Angular的下拉列表示例和Input with clear框组合为:
<mat-form-field >
  <mat-select placeholder="Country" [(value)]="selectedCountry" (selectionChange)="emitItemChanges()">
    <div *ngFor="let item of lstItems|async">
      <mat-option *ngIf="addItem(item)" [value]="item">{{item.title}}</mat-option>
    </div>
  </mat-select>
  <button mat-button *ngIf="selectedCountry" matSuffix mat-icon-button aria-label="Clear" 
    (click)="selectedCountry=undefined">
    <mat-icon>close</mat-icon>
  </button>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
哪个工作接近预期的方式
清除输入。我现在面临的问题是它会立即打开选择框。无论如何如何防止这种行为?
我知道还有其他解决方案可以清除选择。我想知道这种方法是否可行?
据我了解,新的 Angular 7 提供了拖放功能。我搜索了有关 DnD 的 Tree 组件,但没有找到与树相关的太多内容。
我在Stackblitz上找到了一个工作示例。与此处总结的拖放功能相比,该解决方案看起来很清醒。一个更好的示例与ngx-tree-dnd相关。尽管如此,因为我想坚持使用材质,所以出现了一些问题:
新的 Angular Material 15 在颜色和间距方面有一些“突破性”变化。因此我需要覆盖 CSS 变量的默认值。我定义在我的styles.scss
:root {
    --mdc-typography-button-letter-spacing: 'normal';
    --mdc-dialog-supporting-text-color: mat.get-color-from-palette($greyPalette, 900);
}
Run Code Online (Sandbox Code Playgroud)
虽然第一个变量是undefined,因此采用了定义,但第二个变量有一个值但不会被覆盖。
那么,如何正确设置变量呢?
如何在 Angular Material 中制作分割按钮?它应该看起来类似于我尝试过的Bootstrap 示例:
<mat-menu #appMenu="matMenu">
  <button mat-menu-item>... Black Forest</button>
  <button mat-menu-item>... Salted Caramel</button>
</mat-menu>
<mat-button-toggle-group appearance="legacy">
  <mat-button-toggle color="primary" (click)="doSomethingBig()">
    Tell me about Earl Gray Ice Cream
  </mat-button-toggle>
  <mat-button-toggle color="primary" [matMenuTriggerFor]="appMenu">
    <mat-icon>arrow_drop_down</mat-icon>
  </mat-button-toggle>
</mat-button-toggle-group>
Run Code Online (Sandbox Code Playgroud)
我的问题:
legacyas 样式进行外观,则会产生奇怪的效果,即按钮背景透明。color被完全忽略。有没有办法有不同的颜色?特别是如果我想在同一行使用它的两个按钮,而不是一个可以使用primary另一个按钮accent在我们的项目中,我们使用ehcache2.x,现在我们想迁移到3.x,但是以某种方式我失败了。在2.x中,我们有配置ehcache.xml。我读到的是,使用3.x时也需要更改内容。
但是首先,我不知道如何单独连接缓存。我有
@EnableCaching
@Configuration
public class CacheConf {
  @Bean
  public CacheManager cacheManager() {
    final CacheManagerBuilder<org.ehcache.CacheManager> ret = CacheManagerBuilder.newCacheManagerBuilder();
    ret.withCache("properties", getPropCache());
    ret.withCache("propertyTypes", getPropCache());
    return (CacheManager) ret.build(true);
  }
....
Run Code Online (Sandbox Code Playgroud)
但是,我得到的这种配置java.lang.ClassCastException: org.ehcache.core.EhcacheManager cannot be cast to org.springframework.cache.CacheManager意味着我无法ehcache正确设置。
注意:在2.x版本中,我们配置了不同类型的缓存,或多或少是由于有效期-以及其他对象类型存储在其中。
提示使其运行,因为在Spring 5和ehcache3.x中找不到有效的示例?最好是没有xml的配置!