<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="jquery-1.11.1.js"></script>
<script src="angular.min.js"></script>
<script type="text/javascript">
var m1 = angular.module('myApp',[]);
m1.directive('hi',function(){
return {
restrict:'AE',
replace:'true',
transclude:'true',
template:'<div><h1 ng-transclude></h1></div>'
}
}); m1.directive('hello',function (){
return{
restrict:'AE',
template:'<span>title</span>'
}
})
</script>
</head>
<body>
<hi>
<hello></hello>
</hi>
</body>
</html>
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
#div1 div,#div2 div{ width:200px; height:200px; border:1px red solid; display:none;}
#div1 input.active , #div2 input.active{ background:red;}
</style>
<script src="angular.min.js"></script>
<script> var m1 = angular.module('myApp',[]);
m1.directive('hello',function(){
return {
restrict : 'E',
replace : true,
transclude : true,
controller : function($scope){
//$scope.name = 'miaov';
this.name = 'miaov';
this.show = function(){};
},
template : '<div>hello angular<h1 ng-transclude></h1></div>'
};
});
m1.directive('hi',function(){
return {
restrict : 'E',
replace : true,
require : '?^hello',
template : '<span>hi angular</span>',
link : function(scope,element,attr,reController){
console.log( reController );
}
};
}); m1.controller('Aaa',['$scope',function($scope){ }]); </script>
</head> <body ng-controller="Aaa">
<hello>
<hi></hi>
</hello>
</body>
</html>

最新文章

  1. SQL Server Reporting Services:无法检索应用程序文件。部署中的文件已损坏
  2. poj2676 Sudoku
  3. javascript生成GUID的代码
  4. linux常识以及常用命令和参数
  5. MBR中“起始磁头/扇区/柱面“同&quot;逻辑区块地址(LBA)&quot;的区别
  6. 【每日scrum】NO.2
  7. Delphi操作XML的几个博客
  8. Hadoop on Mac with IntelliJ IDEA - 10 陆喜恒. Hadoop实战(第2版)6.4.1(Shuffle和排序)Map端 内容整理
  9. MateSublg
  10. 用VC制作应用程序启动画面
  11. js代码风格之链式结构
  12. DNS over TLS到底有多牛?你想知道的都在这儿
  13. 导入Excel 文件(图片和文字)NPOI+BootStrap fileinput 插件 的结合使用
  14. tomcat中的线程问题2
  15. sql 找出不包含字母、不包含汉字的数据
  16. C# 温故之.NET 异步
  17. centos7 安装php gd库
  18. Vue项目build打包部署到Tomcat后,刷新报404错误解决方案
  19. C# RichTextBox 制作文本编辑器
  20. java注解的概念理解

热门文章

  1. display 垂直居中
  2. 转:mysql grant
  3. tortoise git使用 git版本库的rsa key来进行ssh连接
  4. [ CodeVS冲杯之路 ] P1017
  5. .h 和 .cpp 切换快捷键设置(转)
  6. python enumerate元素的时候可以获取下标,并且可以指定开始的下标值。
  7. popen的用法及与system调用的区别
  8. mogadm修改硬盘状态
  9. kubernetes 安装(全)
  10. Appium+python自动化18-brew、carthage和appium-doctor【转载】