angularjs学习笔记


Cannot find module 'mkdirp'
查看nodejs已经有的插件和版本
npm install –g mkdirp 安装方法
nodejs 练习

1查看nodejs版本命令
node -v
node --version

2 神秘双大括号{{}} ng-model /input双向绑定
{{}}
3 angular的使用实例
<!doctype html>
<html ng-app>
    <head>
        <script src="angular.js"></script>
      
		<script >
			function InvoiceCntl($scope) {
				$scope.qty = 1;
				$scope.cost = 19.95;
			}
		</script>
    </head>
    <body>
        <div ng-controller="InvoiceCntl">
            <b>Invoice:</b>
            <br>
            <br>
            <table>
                <tr><td>Quantity</td><td>Cost</td></tr>
                <tr>
                    <td><input type="integer" min="0" ng-model="qty" required ></td>
                    <td><input type="number" ng-model="cost" required ></td>
                </tr>
            </table>
            <hr>
            <b>Total:</b> {{qty * cost | currency}}
        </div>
    </body>
</html>
4 比较好的 url地址 angularjs
http://www.360doc.com/content/14/0414/15/14416931_368816305.shtml
5 数据绑定问题 ng-app+ng-model+ng-bind
ng-init 是用来初始化用的
ng-repeat 实现了循环
<div ng-app="">
 
<p>在输入框中尝试输入:</p>
<p>姓名: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
<input type="text" ng-model="aaa">
<p ng-bind="aaa"></p>
</div>

<script src="//www.w3cschool.cc/try/angularjs/1.2.5/angular.min.js"></script>

6 过滤器
currency /uppercase/lowercase  orderBy:'name' filter:name 
7 json
 $http.get().success(function(res){xxxx});
8 ng-show true/false
   ng-disabled true;
9 事件 
ng-hide="true"
ng-click="count=count+1"
10 模块使用方法
<div ng-app="pp" ng-controller="ppc">
{{p.name+""+p.age}}
</div>
<script>
var a = angular.module("pp",[]);
   a.controller("ppc",function($scope){

  $scope.p={
   name:"a",
 age:"b",
}
});
11 

<!--
<form novalidate>
<input type="text" ng-model="dd.f">
<input type="text" ng-model="dd.l">
<button ng-click="set()">reset</button>
</form>
-->

$scope.m={f:"f",l:"l"};
$scope.set=function(){
$scope.dd=angular.copy($scope.m);
}    
$scope.set();





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

静山晚风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值