【发布时间】:2017-02-10 07:34:40
【问题描述】:
@Component({
selector: '.donation',
template: `
<figure id="donation" move>
<img src="image/qrcode.png"/>
<figcaption>
Buy me a cup of coffee.
</figcaption>
</figure>
`
})
export class DonationComponent{}
@Directive({
selector: '[move]'
})
export class MoveDirective{}
嘿,我想在MoveDirective 和DonationComponent 中获取<figure id="donation"> 元素的宽度/高度。我已多次阅读文档,但仍然找不到解决此问题的方法。有人知道吗?非常感谢!
【问题讨论】:
标签: angular angular-directive angular-components