<!DOCTYPE html>
<html ng-app="MyApp">
<head>
<title>Study 9</title>
<script type="text/javascript" src="js/angular.js"></script>
</head>
<body>
<div ng-controller="testController">
<hello say="content">Grid</hello>
</div> <script type="text/javascript">
var app = angular.module("MyApp", [], function() { });
app.controller("testController", function($scope) {
$scope.content = "I love you.";
});
app.directive("hello", function() {
return {
restrict: "E",
template: "<div>hello,<b ng-transclude></b>,{{cont}}</div>",
replace: true,
transclude: true,
scope: {
cont: "=say"
}
};
});
</script>
</body>
</html>

示例:

最新文章

  1. 简单的JavaScript互斥锁
  2. opcode的执行
  3. 计算字符串中al_num,spance_num,digit_num,other_num的个数
  4. LINQ使用
  5. TortoiseSVN使用详细步骤
  6. git的使用--不错的博客【转】
  7. 局域网架个YUM源-HTTP的
  8. TMS X-Cloud Todolist with FNC
  9. 分析Cocos2d-x横版ACT手游源 2、server场景
  10. 再谈CVE-2017-7047 Triple_Fetch和iOS 10.3.2沙盒逃逸
  11. 关于SCSI/SATA/IDE硬盘的比较
  12. 18 UI美化状态集合的位图selector
  13. iOS指纹识别Touch ID的安全性探讨
  14. Python多线程的简单实现(生产者消费者模型)
  15. UE4入门(二)建立和打开项目
  16. swift便利构造函数
  17. js对数组对象的操作以及方法的使用
  18. RPDU
  19. git怎么使用
  20. Python自动化之高级语法单例模式

热门文章

  1. Ubuntu 修改IP地址网关
  2. CentOS7.0关于libguestfs的bug
  3. ubuntu基本配置
  4. ZOJ 1201 Inversion
  5. hdu1712 ACboy needs your help 分组背包
  6. Codeforces Round #140 (Div. 2)
  7. LOAD TABLE tbl_name FROM MASTER语法 SQL
  8. scala言语基础学习九
  9. timus 1982 Electrification Plan(最小生成树)
  10. android 多线程下载图片