国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

angular.js - angularjs {{}}questions
PHPz
PHPz 2017-05-15 16:51:54
0
4
653

Why does {{a}} output

in the html interface?
html<span class="ng-binding ng-scope">
4
</span>

And what I expected was

html4

Have you ever encountered a master who can help you with your questions~

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(4)
為情所困

Quoted from the official website:

The ngBind attribute tells Angular to replace the text content of the
specified HTML element with the value of a given expression, and to
update the text content when the value of that expression changes.

means just ngBind會告訴angular去將你寫的表達(dá)式替換成一個特殊的html元素.

And this 特殊的html元素 is the span with class,

Double curly brackets{{}}ngBind是一樣的,實際上是一個directive, there is only a slight difference in the scope of application

Official Document ngBind

淡淡煙草味

The HTML value output by AngularJs ng-bind will definitely not be just 4. Otherwise, how to control the position of the output value?

洪濤

aHow is the value of this variable assigned?
Generally $scope.a=4;
The output result of {{a}} is 4.

伊謝爾倫

Thanks for the invitation. You can see it in the source code of angular https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L1...
In fact, it is used to bind data to this "top text node"

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template