title: Ionic Plugin Creation Using Plugman
body: <p>I'm new to Ionic and Cordova. I need to create a plugin for ionic using Cordova and integrate it in sample ionic app.</p>
  
  <p>Steps I Followed are:</p>
  
  <p>Created a simple ionic plugin using plugman</p>
  
  <pre><code>plugman create --name SayHello --plugin_id cordova-plugin-sayhello -plugin_version 0.0.1
  </code></pre>
  
  <p>Added android platform to above plugin.</p>
  
  <pre><code>cd SayHello/ &amp;&amp; plugman platform add --platform_name android
  </code></pre>
  
  <p>Now I want to integrate this plugin into my ionic app.</p>
  
  <pre><code>ionic cordova plugin add ../SayHello
  </code></pre>
  
  <p>In my ionic app inside Home.ts, I wrote this piece of code.</p>
  
  <pre><code>declare var cordova: any;
  var success = function(result) {
    console.log(result);
  }
  var failure = function(err) {
    console.log(err);
  }
  cordova.plugins.HelloWorld.coolMethod("SayHelloTest", success, failure);
  </code></pre>
  
  <p>The problem is I cannot call any function from success or failure in the ionic app.</p>
  
  <p>like if I call function doSomething from success:</p>
  
  <pre><code>var success = function(result) {
     doSomething(result);
  }
  </code></pre>
  
  <p>It Shows Error doSomething function not found. It can only print in console.</p>