码迷,mamicode.com
首页 > Web开发 > 详细

[转载]AngularJS入门教程01:静态模板

时间:2014-07-22 08:19:36      阅读:207      评论:0      收藏:0      [点我收藏+]

标签: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动态生成相同的列表。

[转载]AngularJS入门教程01:静态模板,布布扣,bubuko.com

[转载]AngularJS入门教程01:静态模板

标签:style   blog   color   使用   strong   文件   

原文地址:http://www.cnblogs.com/gredswsh/p/AngularJS-tutorial01-static-template.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!