首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在角省道组件中使用延迟内容指令?

如何在角省道组件中使用延迟内容指令?
EN

Stack Overflow用户
提问于 2017-02-09 16:43:14
回答 1查看 788关注 0票数 2

我刚刚注意到了新的角飞镖组件,所以我试图这样使用它们:

代码语言:javascript
复制
  <material-expansionpanel-set>
      <material-expansionpanel *ngFor="let place of places" name="{{place.name}}" showSaveCancel="false">
        <div *deferredContent>{{place.name}}</div>
      </material-expansionpanel>
  </material-expansionpanel-set>

我希望div中的元素能够以不同的方式自动显示。我不明白它是如何工作的: div中的语句从未显示过(当然,这只是一个测试,我计划在*deferredContent div中放置一个完整的组件。

这是我得到的html。

代码语言:javascript
复制
<material-expansionpanel-set _ngcontent-toa-2="">
      <!--template bindings={}--><material-expansionpanel _ngcontent-toa-2="" showsavecancel="false" _nghost-toa-10="">
<div _ngcontent-toa-10="" class="panel themeable open" role="group" aria-label="myplace" aria-expanded="true">


  <!--template bindings={}--><header _ngcontent-toa-10="" buttondecorator="" role="button" class="" aria-label="Close myplace panel" tabindex="0" aria-disabled="false">
    <div _ngcontent-toa-10="" class="panel-name">
      <p _ngcontent-toa-10="" class="primary-text">myplace</p>
      <!--template bindings={}-->

    </div>

    <div _ngcontent-toa-10="" class="panel-description">

    </div>

    <!--template bindings={}--><glyph _ngcontent-toa-10="" buttondecorator="" class="expand-button" role="button" _nghost-toa-11="" tabindex="0" aria-disabled="false"><i _ngcontent-toa-11="" aria-hidden="true" class="material-icons">expand_less</i></glyph>
  </header>

  <main _ngcontent-toa-10="" class="">
    <div _ngcontent-toa-10="" class="content-wrapper">
      <div _ngcontent-toa-10="" class="content">

        <!--template bindings={}-->

      </div>
      <!--template bindings={}-->
    </div>

    <!--template bindings={}--><div _ngcontent-toa-10="" class="toolbelt">

    </div>

    <!--template bindings={}-->
  </main>

</div>
</material-expansionpanel>
  </material-expansionpanel-set>

如果我们的想法是实现DeferredContentAware并在组件可见时得到通知,我就会被欺骗(因为我们可以通过侦听打开和关闭事件来手动完成这个任务)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-24 23:35:04

material-expansionpanel应该为*deferredContent自动触发事件。

一些简单的问题:

  • 你的directives: const [ ...]里有directives: const [ ...]吗?
  • 您使用的是什么版本的AngularDart?
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42142235

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档