Angular学习(7)- 模板2
生活随笔
收集整理的這篇文章主要介紹了
Angular学习(7)- 模板2
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
示例:
<!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>?
轉載于:https://www.cnblogs.com/HD/p/3630735.html
總結
以上是生活随笔為你收集整理的Angular学习(7)- 模板2的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 联想s435怎么进bios设u盘启动项
- 下一篇: BootStrap2学习日记16---选