Angular JS 簡單實例


開始學習AngularJS的一個好方法是創建經典應用程序“Hello World!”:

  1. 使用您喜愛的文本編輯器,創建一個HTML文件,例如:helloworld.html。

  2. 將下面的源代碼複製到您的HTML文件。

  3. 在web瀏覽器中打開這個HTML文件。


 HTML 源代碼

<!doctype html>
<html ng-app>
    <head>
        <script type="text/javascript" 
        src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js">
        </script>
    </head>
    <body>
        Hello {{'World'}}!    
    </body>
</html>

請在您的瀏覽器中運行以上代碼查看效果。


由於偉大的牆的存在, js 文件可能獲取不到,  提供一個備用地址: http://cdn.bootcss.com/angular.js/1.2.3/angular.min.js


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章