Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('app', [])
- .directive('myDirective' ,function(){
- return {
- restrict: 'E',
- replace: true,
- template: '<div><p></p><input type="text" ng-init="someText = \'\'" ng-model="someText"></div>',
- link: function(scope, element){
- scope.$watch('someText', function () {
- element.find('p').text(scope.someText)
- })
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement