# There is some problem when I inherit ColorMaterialProperty in typescript file

**URL:** <https://community.cesium.com/t/there-is-some-problem-when-i-inherit-colormaterialproperty-in-typescript-file/19583>\
**Category:** CesiumJS\
**Created:** [July 18, 2022, 8:27am UTC](https://community.cesium.com/t/there-is-some-problem-when-i-inherit-colormaterialproperty-in-typescript-file/19583 "2022-07-18T08:27:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aoi](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/aoi/32/9171_2.png) [@Aoi](https://community.cesium.com/u/Aoi)\
**Post date:** [July 18, 2022, 8:27am UTC](https://community.cesium.com/t/there-is-some-problem-when-i-inherit-colormaterialproperty-in-typescript-file/19583/1 "2022-07-18T08:27:36Z")

</div>

Here are some key codes…

Before this I successfully inherit `Material` (`CustomColorTypeMaterial`) in TS file and use in `Primitive`.

`CustomColorMaterialProperty.ts`

```nohighlight
export class CustomColorMaterialProperty extends ColorMaterialProperty

```

`MaterialProperty` can not be inherited, So I inherit `ColorMaterialProperty`.  
Override method getType:

```nohighlight
 public getType(time: JulianDate): string {
    return "CustomColorType";
  }

```

`Bussiness.ts`

```nohighlight
entities.add({
      polyline: {
        positions: Cartesian3.fromDegreesArray(lineConcat),
        material: new CustomColorMaterialProperty (),
      },
    });

```

I found that `getType` is never called. And custom styles were not applied successfully.

how to inherit `MaterialProperty` (`CustomColorMaterialProperty.ts`) and use in `Entity`.
