[@ .disabled] =“true”导致控制台错误

问题描述 投票:0回答:1

我想在某些时候禁用角度动画,因此在qazxsw poi中找到了qazxsw poi。

所以我想像这样使用它:[@.disabled]="isDisabled"(只是为了测试它)我得到不断的错误:docs

错误文字:

[@.disabled]="true"

码:

enter image description here

是否缺少进口?为什么说'ERROR DOMException: Failed to execute 'setAttribute' on 'Element': '[@.s' is not a valid attribute name. at DefaultDomRenderer2.push.../../node_modules/@angular/platform-browser/fesm5/platform-browser.js.DefaultDomRenderer2.setAttribute (http://localhost:4200/vendor.js:134848:16) at AnimationRenderer.push.../../node_modules/@angular/platform-browser/fesm5/animations.js.BaseAnimationRenderer.setAttribute (http://localhost:4200/vendor.js:133467:23) at DebugRenderer2.push.../../node_modules/@angular/core/fesm5/core.js.DebugRenderer2.setAttribute (http://localhost:4200/vendor.js:85125:23) at createElement (http://localhost:4200/vendor.js:81803:22) at createViewNodes (http://localhost:4200/vendor.js:84036:26) at createEmbeddedView (http://localhost:4200/vendor.js:83983:5) at callWithDebugContext (http://localhost:4200/vendor.js:84997:25) at Object.debugCreateEmbeddedView [as createEmbeddedView] (http://localhost:4200/vendor.js:84521:12) at TemplateRef_.push.../../node_modules/@angular/core/fesm5/core.js.TemplateRef_.createEmbeddedView (http://localhost:4200/vendor.js:82564:38) at ViewContainerRef_.push.../../node_modules/@angular/core/fesm5/core.js.ViewContainerRef_.createEmbeddedView (http://localhost:4200/vendor.js:82430:35) 属性是 <ng-container *ngIf="!something" [@.disabled]="true"> .... <div [@fadingListAnimation]="otherthing">

angular angular-animations
1个回答
2
投票

您必须从'[@.s' is not a valid attribute name.中删除已禁用的动画,因为这些容器未在最终的HTML页面上呈现。

你无法为不存在的东西制作动画!

© www.soinside.com 2019 - 2024. All rights reserved.