Angular4 模板引用变量赋值 [英] Angular4 template reference variable assignment

查看:30
本文介绍了Angular4 模板引用变量赋值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个例子,我们可以看到:

I've come across this example where we can see:

<md-menu #menu="mdMenu">

我找不到对这个模板的 ="mdMenu" 部分的任何引用 在文档中.

I can't find any reference to the ="mdMenu" part of this template in the docs.

这有什么意义还是只是例子中的错误?

Is there some meaning to this or is it just a mistake on the example?

推荐答案

在文档中 [mdMenuTriggerFor]="menu" 指的是 <md-menu #menu="mdMenu">

#menu="mdMenu"中,mdMenu是从Material导出的指令.

and in #menu="mdMenu", mdMenu is the directive exported from Material.

这篇关于Angular4 模板引用变量赋值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆