Freewind @ Thoughtworks scala java javascript dart 工具 编程实践 月结 math python english [comments admin] [feed]

(2013-01-01) 02. 起步程序

广告: 云梯:翻墙vpn (省10元) 土行孙:科研用户翻墙http proxy (有优惠)

https://github.com/angular/angular.js/blob/master/docs/content/guide/bootstrap.ngdoc

概览

本页讲解Angular的初始化过程,以及你在需要的时候如何手动初始化。

Angular的<script>标签

下面这个例子是我们推荐的“自动初始化Angular”的方式:

<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app>
  <body>
    ...
    <script src="angular.js">
  </body>
</html>

你的代码应该遵循以下顺序:

  1. 当页面和所有代码导入完毕后,寻找HTML模板的根,它通常也是文档的根2. 调用bootstrap方法来编译模板,把它变成一个可执行的、双向绑定的程序
comments powered by Disqus