angulardart/angular

Sanity check directives|pipes|providers for validitity

開放

#539 建立於 2017年7月19日

 (3 則留言) (0 個反應) (0 位負責人)Dart (237 個分叉)batch import
area: compilergood first issue⛈ experience: new user⛑ breaking change

倉庫指標

星標
 (1,855 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

@Component(selector: 'test-component',
                   directives: const [NgIf, NgFor],
                   template: 'It works!')
class TestComponent {
...

produces the following HTML:

<test-component>It works!</test-component>

If for some reason you were not really awake and write this:

@Component(selector: 'test-component',
                   directives: const [NgIf, NgFor, DatePipe],
                   template: 'It works!')
class TestComponent {
...

you end up with the follow HTML:

<test-component></test-component>

No visible error in pub serve nor in the dartium console. A .template.dart file for the faulty component is generated but the content is the same as if you omit the template property in Component annotation.

I didn't tested this with Angular 4 alpha

貢獻者指南