AngularJS : Why ng-bind is better than {{}} in angular?

前端 未结 12 792
灰色年华
灰色年华 2020-11-22 07:19

I was in one of the angular presentation and one of the person in the meeting mentioned ng-bind is better than {{}} binding.

One of the re

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 07:40

    If you are not using ng-bind, instead something like this:

    Hello, {{user.name}}

    you might see the actual Hello, {{user.name}} for a second before user.name is resolved (before the data is loaded)

    You could do something like this

    Hello,

    if that's an issue for you.

    Another solution is to use ng-cloak.

提交回复
热议问题