Angular学习(7)- 模板2
2014-03-28 15:17
190 查看
示例:
<!DOCTYPE html> <html ng-app="MyApp"> <head> <title>Study 8</title> <script type="text/javascript" src="js/angular.js"></script> </head> <body> <hello>Robin</hello> <test-template></test-template> <script type="text/javascript"> var app = angular.module("MyApp", [], function() { }); app.directive("hello", function() { return { restrict: 'E', template: "<div>Hello,<b ng-transclude></b></div>", replace: true, transclude : true }; }); app.directive("testTemplate", function() { return { restrict: 'E', templateUrl: "test.html", replace: true }; }); </script> <script type="text/ng-template" id="test.html"> <div>Test Template</div> </script> </body> </html>
相关文章推荐
- angular学习(一):动态模板总结
- angular学习(一):动态模板总结
- Angular学习(7)- 模板
- Angular2学习笔记.3、通过模板调用Controller事件实现用户输入和显示,UserInput
- Angular2文档学习的知识点摘要——模板语法
- Angular学习(十一)——$watch、模板数据的展现
- C++模板学习
- angular学习笔记(三十)-指令(7)-compile和link(2)
- angular学习之四实例:点击收缩展开下拉
- Angular 5.x 学习笔记(1)——概述
- C++模板学习
- 模板方法模式- 设计模式学习
- JavaMail学习笔记-4(邮件模板的套用,例如论坛注册回复邮件)
- Tornado 文档学习:模板与 UI
- 设计模式学习笔记——模板方法模式
- DirectX模板学习
- Django 学习笔记(四)模板变量
- linux网络设备应用与驱动编程学习4——模板与实例(A)
- “模板”学习笔记(6)-----类也可以有模板
- C++模板学习