首页 > 解决方案 > 无需使用组件中的snackbar 即可个性化snackbar

问题描述

我的问题很简单,但我似乎找不到任何方法让它工作。这是我的小吃店方法:

this.snackBar.open('The selected object cannot be deleted. The object2 with' + '\n' + ' the following IDs ' + A + ' depend on it. They need to be deleted first.', '', {
      duration: 4000,
    });

有没有一种简单的方法可以在不使用从组件打开或从模板打开的情况下将新行(简单地添加+ '\n'不起作用)添加到快餐栏上显示的消息?

谢谢 !

标签: angulartypescriptangular-materialsnackbar

解决方案


推荐阅读