Advertisement
Guest User

create custom directive

a guest
Sep 17th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <!-- laern create Own Custom directive -->
  4.     <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
  5.     <body ng:app="app5" ng:controller="xCon">
  6.         <input type="text" ng:model="nama" ng:init="nama='hahah'" />
  7.         <a ng-bind="nama" href="#"></a>
  8.        
  9.         <br />
  10.         Custome Directive :
  11.         <my-customer></my-customer>
  12.     </body>
  13.     <script>
  14.         var app5 = angular
  15.         .module('app5',[])
  16.         .controller('xCon', ["$scope", function($scope){
  17.             $scope.nama = 'wakwau';
  18.         }])
  19.         .directive('myCustomer', function() {
  20.           return {
  21.             template: 'Nama dia: {{nama}} '
  22.           };
  23.         });
  24.        
  25.     </script>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement