[AngularJS] - Directives 3
RUN
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Ví dụ sử dụng Directive</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <script language="javascript"> angular.module('myapp', []) .controller('MyController', function($scope) { // }) .directive('myDirective', function() { return { template: '<h1>Chào mừng các bạn đến với website freetuts.net</h1>' }; }); </script> </head> <body ng-app="myapp"> <div ng-controller="MyController"> <div my-directive></div> </div> </body> </html>
PHÓNG TO