<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script src="angular.min.js"></script>
<script>
//对网址信息进行2次的封装。 var m1 = angular.module('myApp',[]);
m1.controller('Aaa',['$scope','$location',function($scope,$location){
var a = $location.absUrl();//网址的绝对地址(加的参数进行了编码)
$location.path('aaa/bbb/ccc').replace();
$location.hash('hello');
$location.search({'age':''});
var a = $location.protocol();//地址的协议
console.log(a);
}]); </script>
</head>
<body>
<div ng-controller="Aaa">
</div>
</body>
</html>
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
#parent div{ width:300px; height:500px; border:1px # solid; margin:20px;}
#parent ul{ width:200px; position:fixed; top:; right:;}
</style>
<script src="angular.min.js"></script>
<script> var m1 = angular.module('myApp',[]);
m1.controller('Aaa',['$scope','$location','$anchorScroll',function($scope,$location,$anchorScroll){
$scope.change = function(id){
//console.log(id);
$location.hash(id);
$anchorScroll();//锚点跳转
};
}]); </script>
</head> <body>
<div id="parent" ng-controller="Aaa">
<ul>
<li ng-repeat="id in [1,2,3,4,5]" ng-click="change('div'+id)">{{id}}aaaaaaaaaa</li>
</ul>
<div ng-repeat="id in [1,2,3,4,5]" ng-attr-id="div{{id}}">{{id}}</div>
</div>
</body>
</html>

最新文章

  1. mybatis中表与表之间的关联
  2. 【转】Android Canvas绘图详解(图文)
  3. linux C(hello world)三个数最大和三个数最新
  4. 【零基础学习iOS开发】【02-C语言】05-进制
  5. iOS开发——UI篇OC篇&amp;UIView/UIWindow/UIScreen/CALayer
  6. Aspose.word总结
  7. linux下 修改配置文件的命令
  8. 面向对象设计模式之Facade外观模式(结构型)
  9. doxygen学习笔记
  10. HDU 3507 PrintArticle (单调队列优化)
  11. 【剑指offer】面试题22:栈的压入、弹出序列
  12. 关于 MVC 字段 默认值
  13. 在cad中画一条长500mm,垂直90度的线段
  14. Python类之类的成员
  15. 动态规划法(十)最长公共子序列(LCS)问题
  16. github上传超过100mb文件怎么办
  17. IntelliJ IDE 常用配置
  18. python笔记二
  19. (后端)如何将数据库的表导出生成Excel?
  20. ethereum发erc20token

热门文章

  1. [terry笔记]文件操作
  2. 2015 Multi-University Training Contest 3 hdu 5324 Boring Class
  3. 【转】 C#获取当前程序运行路径的方法集合
  4. Spring中 @Autowired标签与 @Resource标签 的区别(转)
  5. POJ2449题解
  6. 《Head First 设计模式》学习笔记——适配器模式 + 外观模式
  7. dotnet core test with NUnit
  8. legend---十一、thinkphp事务中if($ans1&amp;&amp;$ans2){}else{}方式和try{}catch{}方式事务操作的区别在哪里
  9. Linux就该这么学 20181003(第三章管道符)
  10. ubuntu12.04下NFS链接开发板并测试交叉编译的第一个应用