Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('app', [])
  2. .directive('myDirective' ,function(){
  3.   return {
  4.     restrict: 'E',
  5.     replace: true,
  6.     template: '<div><p></p><input type="text" ng-init="someText = \'\'" ng-model="someText"></div>',
  7.     link: function(scope, element){
  8.  
  9.     scope.$watch('someText', function () {
  10.       element.find('p').text(scope.someText)
  11.     })  
  12.     }
  13.   }
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement