当前位置:文档之家› angularjs前端分离框架(第2部分)

angularjs前端分离框架(第2部分)

2017.11.21-angularjs前端分离框架(第2部分)

angularjs(ng)学习大纲:
---------------------------------------------------
1.ng作用
2.ng实例
3.ng表达式
4.ng模型
5.ng作用域
6.ng控制器
7.ng过滤器
8.ng service服务
9.ng http异步通讯(ajax)
10.ng select
11.ng表格
12.ng SQL
13.ng DOM
14.ng事件
15.ng模块
16.ng表单
17.ng表单验证
18.ng api
19.ng文件包含
20.ng路由
21.ng应用

今天内容:
-------------------------------------------------------
ng模型:


ng作用域:
$https://www.doczj.com/doc/181357337.html,ername='user456';
$scope.say=function(){
return 'abc';
}

ng控制器:
app=angular.module('myapp',[]);
app.controller('myctl',function($scope){
$https://www.doczj.com/doc/181357337.html,ername='user1';
$scope.password='123';
});

ng过滤器:
1.currency
2.filter
3.lowercase
4.uppsercase
5.orderBy

ng服务:
1.$location
2.$http
3.$timeout
4.$interval

ng http服务:
$http.get('get.php').success(function(res){
$scope.sites=res.sites;
});

ng select:


ng表格:












名称:地址:国家:
{{https://www.doczj.com/doc/181357337.html,}}{{site.Url|uppercase}}{{site.Country|lowercase}}


ng SQL:
$sql="select * from user";
$rst=mysql_query($sql);
while($row=mysql_fetch_assoc($rst)){
$rows[]=$row;
}
$str=json_encode($rows);
echo $str;
?>

ng DOM:
1.ng-disabled
2.ng-show
3.ng-hide

ng事件:


ng模块:
app=angular.module('myapp',[]);

ng控制器:
app.controller('myctl',function($scope,$http){
$scope.dis=function(){
$scope.ns='true';
}
});

ng表单:
$scope.master={'username':'user1','password':'123'};
$scope.reset=function(){
$https://www.doczj.com/doc/181357337.html,er=angular.copy($scope.master);
}
$scope.reset();


相关主题
文本预览
相关文档 最新文档