title: How can I convert angularJS directive to Typescript?
body: <p>Hi everyone i need to a directive. That should styled to decimal numbers. And i found what exactly i want.  But i didn't run this code on my project. </p>
  
  <p>I'm using:</p>
  
  <blockquote>
    <p>ionic (Ionic CLI)  : 4.2.1</p>
  </blockquote>
  
  <p>That's code:</p>
  
  <pre><code>  app.directive('salary', function(){
    return {
        restrict: 'E'
        , scope: {
            salary: '@'
        }
        , controller: controller
        , controllerAs: 'dvm'
        , bindToController: true
        , template: '&lt;h2&gt;&lt;sup&gt;$&lt;/sup&gt;{{ dvm.dollar }}&lt;sub&gt;.{{ dvm.cents }}&lt;/sub&gt;&lt;/h2&gt;'
    };
  
    function controller(){
      var parts = parseFloat(this.salary).toFixed(2).split(/\./);
      this.dollar = parts[0];
      this.cents = parts[1];
    }
  });
  </code></pre>
  
  <p><a href="https://plnkr.co/edit/Em5SSeHBQBffHvQS8E1z?p=preview" rel="nofollow noreferrer">plunker</a></p>
  
  <p>Thanks for your help!</p>