AngularJS是一款前端JS框架。AngularJS官网 http://angularjs.org

【开发环境准备】:

1,下载AngularJS:JS and CSS in Solution

2,编辑器 WebStorm,下载地址:https://www.jetbrains.com/webstorm/  (配合最新版JetBrains使用,可以即时无刷新显示更新代码后的效果)

3,下载最新版Chrome,并安装扩展程序:JetBrains IDE Suport,(需要FQ)

下载地址:https://chrome.google.com/webstore/detail/hmhgeddbohgjknpmjagkdomcpobmllji

安装完毕以后Debug看一下效果:webstorm中保存代码,chrome立即显示更新代码后的效果

AngularJS 学习笔记(1)

  {{}}绑定不仅可以直接绑定在HTML标签内容中,而且还可以 绑定在Class属性的值中

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>1.1 HelloWorld</title>
    <link rel="stylesheet" href="css/foundation.min.css">
    <script src="script/angular.js"></script>
</head>

<body ng-app>

    {{1+6}}<br/>
    {{2*4}}<br/>
    {{'hello world'}}
    {{'橙子'+' 你好'}}<br/>
    <input type="text"  ng-model="data.message"/>
    <h1>{{data.message}}</h1>
    <div  class="{{data.message}}">
    wrap me with a foundation component
    </div>
</body>
</html>
View Code

相关文章: