title: Clear local storage is not working in Angular 7?
body: <p>Clear local storage when click on logout button is not working, also I am not doing it with controller files I use only <strong>.ts</strong> and <strong>.HTML</strong> also I am having error while making function does there nay method to do it without making function too? Any feature of Angular?</p>
  
  <p>Here is my <strong>HTML file</strong></p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 19.315" width="20"&gt;
                      &lt;g id="logout"  transform="translate(0
                         -1.66)" &gt; &lt;/svg&gt;
  </code></pre>
  
  <p>Here is my <strong>ts file</strong></p>
  
  <pre><code>  public articlepara = { clientid: localStorage.getItem('storageselectedclient'), page: 1, type: 'All', keytype: '', sortdate: 'asc', sortpub: '', sortnews: '', fromdate: this.fromdate, todate: this.todate, publicationFilter: '', sortprominence: '' }
    user = {
      email: localStorage.getItem('email')
    }
  
  
    constructor(public article: ArticleService, http: HttpClient, elementRef: ElementRef, public _client: ClientService, private spinnerService: Ng4LoadingSpinnerService, private helper: HelperService, excelService: ExcelService, private filterPipe: FilterPipe) {
    }
  
    ngOnInit() {
  
      $("#reset").hide();
      var self = this;
      // $(document).ready(function(){
      $("#dateclick").click(function () {
        $('#rangeCal').toggle();
      })
      updateConfig();
      function updateConfig() {
        var options: { dateLimit: String } = {
          dateLimit: ""
          //,minDate: moment().subtract(365, 'days') , maxDate: moment() 
        };
        $('#config-demo').daterangepicker(options, function (start, end, label) {
  
          var startDateRange = end.format('YYYY-MM-DD');
          var endDateRange = start.format('YYYY-MM-DD');
          self.articlepara.todate = endDateRange;
          self.articlepara.fromdate = startDateRange;
          self.spinnerService.show();
  
          self.isActiveToday = false;
          self.isActive7Days = false;
          self.isActiveYesterday = false;
          self.isActivedaterange = true;
        });
      }
      //  });
  
      this.articlepara.type = 'ALL';
      this.articlepara.keytype = '';
      // this.articlepara.prominance = '';
      // this.articlepara.company = '';
      // this.articlepara.author = '';
      this.articlepara.publicationFilter = '';
  
      this.Clients();  //uncomment for client list
      this.selectedclient = localStorage.getItem('storageselectedclient');
  
      this.spinnerService.show();
  
    }
    Clients() {
      //console.log(this.user);
      // this.spinnerService.show();
      this._client.getClients(this.user)
        .subscribe(
          res =&gt; {
            // console.log(res);
            this.clientlist = res;
          },
          err =&gt; {
            console.log(err);
          },
          () =&gt; {
            // this.getallarticles();
            this.spinnerService.show();
            this.getUserDetails();
          }
        )
    }
    getUserDetails() {
      var postData = {
        clientid: localStorage.getItem('storageselectedclient'),
        email: localStorage.getItem('email')
      }
  
      this.article.getUserDetails(postData)
        .subscribe(
          res =&gt; {
            // console.log(res);
            this.userdetails = res[0];
          },
          err =&gt; {
            console.log(err);
          }
        )
      this.getUserClientDetails();
    }
    getUserClientDetails() {
      var postData = {
        clientid: localStorage.getItem('storageselectedclient')
      }
  
      this.article.getUserClientDetails(postData)
        .subscribe(
          res =&gt; {
            // console.log(res);
            this.userClientdetails = res[0];
            this.spinnerService.hide();
          },
          err =&gt; {
            console.log(err);
          }
        )
    }
    //=======================change selectd client form dropdownlist=============================//
    changeclient(value) {
      localStorage.setItem('storageselectedclient', value);
      localStorage.removeItem('storageselectedclient')
      this.spinnerService.show();
      this.getUserDetails();
    } 
  </code></pre>