? HTML ??????? {{a}}?
? ?????? ??????? ?? ??? ??
??????? ??? ??? ? ? ?? ??? ?? ?? ???~
學(xué)習(xí)是最好的投資!
?? ?????? ??:
ngBind
??? Angular????? HTML ??
? ??? ???? ??? ???? ??? ????
?? ???? ?? ???? ??? ??? ???????.ngBind
attribute tells Angular to replace the text content of thespecified HTML element
with the value of a given expression, and to
update the text content when the value of that expression changes.
意思就是ngBind
會(huì)告訴angular去將你寫的表達(dá)式替換成一個(gè)特殊的html元素
。
而這個(gè)特殊的html元素
就是那個(gè)帶class的span了,
雙花括號(hào){{}}
和ngBind
是一樣的,實(shí)際上是一個(gè)directive
ngBind
? ??? ???? ?? html ??
? ???? ??? ????? ?????. ??? ?
?? html ??
? ???? ??? ?????. ??
???? ??? {{}}
? ngBind
? ??? ???
??? ?? ??? ?? ????. ??
???? ?? ngBind??AngularJs ng-bind? HTML ? ??? ??? 4? ????. ??? ??? ?? ?? ??? ????? ??????
?????? ?????. ?? https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L1...
?? ???? ? ? ????.
??? ? "??? ??? ??"? ???? ????? ? ?????