-4

我是一个新手,我想知道 {} 在 AngularJS 中是如何工作的,例如:

    <p>Hi, {{user}}</p>

谢谢

4

2 回答 2

1

他们编译您的数据。

快速示例:

在控制器中:

$scope.user = "Someone who don't read the basics in the manual";

鉴于:

<p>Hi, {{user}}</p>
<input ng-model="user" /> <!-- whenever this input field changes, the {{user}} above also changes -->
于 2013-10-22T08:38:56.477 回答
0

从基础复制:

{{}}是一种在 HTML 中指定数据绑定位置的声明方式。每当“用户”属性更改时,AngularJS 都会自动更新此文本。

于 2013-10-22T08:39:03.603 回答