[轉載]AngularJS入門教程01:靜態模板

來源:互聯網
上載者:User

標籤:style   blog   color   使用   strong   檔案   

為了說明angularJS如何增強了標準HTML,我們先將建立一個靜態HTML頁面模板,然後把這個靜態HTML頁面模板轉換成能動態顯示的AngularJS模板。

在本步驟中,我們往HTML頁面中添加兩個手機的基本資料,用以下命令將工作目錄重設到步驟1。

git checkout -f step-1

 

請編輯app/index.html檔案,將下面的代碼添加到index.html檔案中,然後運行該應用查看效果。

app/index.html

<ul>    <li>        <span>Nexus S</span>        <p>        Fast just got faster with Nexus S.        </p>    </li>    <li>        <span>Motorola XOOM™ with Wi-Fi</span>        <p>        The Next, Next Generation tablet.        </p>    </li></ul>

 

練習

嘗試添加多個靜態HTML代碼到index.html, 例如:

<p>Total number of phones: 2</p>

 

總結

本步驟往應用中添加了靜態HTML手機列表, 現在讓我們轉到步驟2以瞭解如何使用AngularJS動態產生相同的列表。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.