Difference between 2 type of displaying data in Angular 2

前端 未结 2 1668
天命终不由人
天命终不由人 2021-01-25 07:19

I have some Angular2 code:


and


Note:

2条回答
  •  萌比男神i
    2021-01-25 08:02

    1) NOTE : don't use "" & {{}} together else value will be stringified.

    src="{{value}}" 
    

    value will always be stringified.


    2)

    Here, value is an expression which will be evaluated for the property binding.

    [src] to be precise, this is an angular2 way property binding syntax.

     
    

    So, it will bind value's evaluated value to src property.

提交回复
热议问题