How to access to GeoJson Entities

Hello!!

I need help, im trying to get access to entities about a GeoJson.

Im load it, on Ionic APP, i have this code:

this.viewer.dataSources.add(this.promise(‘ryan’))

private promise(ryan): any {
return new Cesium.GeoJsonDataSource.load(
“assets/ne_10m_us_states.topojson”
);
this.promise(ryan).then(function(dataSource){
var entities = dataSource.entities.values;
var colorHash = {};
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
var name = entity.name;
var color = colorHash[name];
if (!color) {
color = Cesium.Color.fromRandom({
alpha: 1.0,
});
colorHash[name] = color;
}
entity.polygon.material = color;
entity.polygon.outline = false;
entity.polygon.extrudedHeight =
entity.properties.Population;
}
}).otherwise(function (error) {
window.alert(error);
});
}

this is the example of Cesium Sancastle, but im trying to load with Ionic Framework…

image

i have an error… cuz, i read “…Unreachable code detected.ts(7027)…”

how i can do it?

Thanks a lot…