angulardart/angular

Sanity check directives|pipes|providers for validitity

オープン

#539 opened on 2017/07/19

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)Dart (237 件のフォーク)batch import
area: compilergood first issue⛈ experience: new user⛑ breaking change

Repository metrics

Stars
 (1,855 個のスター)
PR merge metrics
 (30d に merged 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

コントリビューターガイド