Angular 2: Difference between property binding with and without brackets?

后端 未结 5 526
失恋的感觉
失恋的感觉 2020-12-16 10:39

I noticed it\'s possible to property bind stuff without brackets. What is the difference?

Typescript:

import { Component, Input } from \'@angular/cor         


        
5条回答
  •  不思量自难忘°
    2020-12-16 11:20

    From Docs - Remember the brackets:

    The brackets, [], tell Angular to evaluate the template expression. If you omit the brackets, Angular treats the string as a constant and initializes the target property with that string.

提交回复
热议问题