title: Can I call angular Component Function Inside html file of another component
body: <p>I have one CommonFunction Component which defines all common functions required for my application.. 
  I am trying to call these functions directly from html file.. whether its possible.. how can I achieve this?..</p>
  
  <p>Please have a look on below example:</p>
  
  <p>common.function.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  
  
  @Injectable({
    providedIn: 'root'
  })
  export class CommonFunction {
    public static userData = JSON.parse(localStorage.getItem("userData"));
  
    public static isDealerLoggedIn(){
      if(this.userData.userType == "DEALER"){
        return true;
      }else{
        return false;
      }
    }
  }
  </code></pre>
  
  <p>home.component.ts</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { CommonFunction } from '../../_services/common.function';
  @Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.scss']
  })
  export class HomeComponent implements OnInit {
  
   constructor(){}
   ngOnInit() {
   }
  }
  </code></pre>
  
  <p>home.component.html</p>
  
  <pre><code>&lt;body&gt;
  &lt;button class="btn btn-info" [disabled]={{CommonFunction.isDealerLoggedIn()}} type="submit"&gt;Dealer Cant Click &lt;/button&gt;
  &lt;/body&gt;
  </code></pre>