AngularJS入门4-小例子-自定义标签
效果图:
代码:
1 <div ng-app="app"> 2 <hello></hello> 3 </div> 4 <script> 5 var appModule= angular.module('app',[]); 6 appModule.directive('hello',function(){ 7 return { 8 restrict:'E', 9 template:'<div>template of hello</div>', 10 replace: true 11 } 12 }); 13 </script> 14 <script src="./angular.min.js"></script>