Ng bootstrap ngb警报仅适用于type=";“成功”;还是不打字
我有下面的代码,它可以工作Ng bootstrap ngb警报仅适用于type=";“成功”;还是不打字,ng-bootstrap,Ng Bootstrap,我有下面的代码,它可以工作 <ngb-alert *ngIf="alertError" class="fade animate-show animate-hide" (close)="alertError = false"><strong>{{ message }}</strong></ngb-alert> <ngb-alert *ngIf="alertSuccess" class="animate-show animate-hide" t
<ngb-alert *ngIf="alertError" class="fade animate-show animate-hide" (close)="alertError = false"><strong>{{ message }}</strong></ngb-alert>
<ngb-alert *ngIf="alertSuccess" class="animate-show animate-hide" type="success" (close)="alertSuccess = false"><strong>{{ message }}</strong></ngb-alert>
那么,请一些专家告诉我这里出了什么问题?为什么类型“主要”或“危险”不起作用 我想你只是不允许在这里使用
fade
类
class="fade animate-show animate-hide"
如果我运行你的代码,它只会显示成功。
但是如果我删除fade
类,它会同时显示这两条消息
编辑
我比较了你和我的依赖列表
你试过更新你的LIB吗您可以从命令行运行此命令:
npm update -D && npm update -S
您拥有的依赖项,而我没有:
"angular-loader": "^1.6.5",
"font-awesome": "^4.7.0",
"primeng": "^4.1.3",
"screenshot-desktop": "^1.1.0",
"underscore": "^1.8.3"
我特别想知道第一个。
你知道这是干什么用的吗?根据它的文档,这是一个角度JS依赖关系。我遇到了一个类似的问题。我的问题是,我认为我正在传递一个变量,从中读取类型。显然没有名为
primary
的变量,所以它失败了。将内容更改为[type]=“'primary'”
完全解决了这个问题
{{message}}
我试过了,但还是不管用。我猜是其他原因造成的。我将尝试比较您提供的依赖项列表,并将我的答案与依赖项差异列表进行比较。我希望这能帮你找到问题。天哪,这让我发疯了!非常感谢你!
npm update -D && npm update -S
"angular-loader": "^1.6.5",
"font-awesome": "^4.7.0",
"primeng": "^4.1.3",
"screenshot-desktop": "^1.1.0",
"underscore": "^1.8.3"