title: How can I delete a property from an object in Angular using diectives?
body: <p>I  make a two directive's .On one directive I have <strong>delete</strong> button.and second directive I get a object value form shared service .Now I want to delete that value from delete button ,I try to empty my object but it is not taking place why ..? if i am doing wrong what is best way to do this task ?</p>
  
  <p>plunker
  <a href="http://plnkr.co/edit/Yenmira9J9XpjscQzRoX?p=preview" rel="nofollow">http://plnkr.co/edit/Yenmira9J9XpjscQzRoX?p=preview</a></p>
  
  <p>code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
    &lt;head&gt;
      &lt;link rel="stylesheet" href="style.css"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body ng-app="app"&gt;
      &lt;a&gt;&lt;/a&gt;
      &lt;b&gt;&lt;/b&gt;
      &lt;script&gt;
        angular.module('app',[]).directive('a',function(){
  
       return {
      restrict :'E',
      scope:{},
      templateUrl:'a.html',
      controller:'ts',
      controllerAs:'vm'
    }
  
        }).controller('ts',function(sharedService){
          var vm=this;
          vm.delete=function(){
            alert('--');
            sharedService.deletepro();
          }
  
        }).directive('b',function(){
  
       return {
      restrict :'E',
      scope:{},
      templateUrl:'b.html',
      controller:'bb',
      controllerAs:'vm'
    }
  
        }).controller('bb',function(sharedService){
          var pm=this;
          pm.message= sharedService.sendData();
  
        }).service('sharedService',function(){
           var vm =this
           vm.data={};
           vm.sendData=sendData;
           vm.deletepro=deletepro;
           function deletepro(){
              vm.data={};
           }
           function sendData(){
             var obj ={name:"pQr"};
             vm.data=obj;
             return vm.data;
           }
  
        })
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I try to delete like that but not work </p>
  
  <pre><code>vm.delete=function(){
            alert('--');
            sharedService.deletepro();
          }
  </code></pre>
  
  <p>Update answer provide not working </p>
  
  <p>updated plinker</p>
  
  <p><a href="http://plnkr.co/edit/Yenmira9J9XpjscQzRoX?p=preview" rel="nofollow">http://plnkr.co/edit/Yenmira9J9XpjscQzRoX?p=preview</a></p>