Trouble Building Custom plugin in ionic



I am using Ionic to build and app, and trying to make my own Android plugin,

I am using this tutorial

but when i get to the part to use

    export class HelloWorld extends IonicNativePlugin {
    successIndex : 1,
    errorIndex : 2
  coolMethod(options: {}): Promise<any> {

I get an exception Object(…) is not a function, About the Cordova and Plugin Decorators.

What do I do? Is there another way to call this plugin?