BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="//cdn.staticfile.net/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app="myApp"> <waitang-directive></waitang-directive> <script> var app = angular.module("myApp", []); app.directive("waitangDirective", function() { return { template : "<h1>自定义指令!</h1>" }; }); </script> </body> </html>
运行结果