Attribute value binding: square brackets vs curly brackets

前端 未结 2 608
醉梦人生
醉梦人生 2021-01-17 20:18

I\'ve downloaded Angular CLI 6.0.7 for Node and am playing around with it, following tutorials, etc. to learn as much as possible.

One thing I have a question about

2条回答
  •  再見小時候
    2021-01-17 21:04

    They may seem to be the same but, {{ }} will convert the input to a string. However if you want to input a number or an object, you must use [ ].

    I included a stackblitz representation for the same here

提交回复
热议问题