santhoshkumarch santhoshkumarch - 2 months ago 8
TypeScript Question

What is the required type argument?

error TS2314: Generic type 'Type' requires 1 type argument(s) while upgrading ionic 2.1.0 in my app.component.ts page.

Answer

What is the required type argument?

When something needs a generic and isn't provided. E.g.

class Foo<T>{
    data:T
}

class Bar extends Foo { } // Missing generic argument

Fix

Provide the generic argument e.g.

class Foo<T>{
    data:T
}

class Bar extends Foo<number> { }