How to access to GeoJson Entities


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

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


private promise(ryan): any {
return new Cesium.GeoJsonDataSource.load(
var entities = dataSource.entities.values;
var colorHash = {};
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
var 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 =;
}).otherwise(function (error) {

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


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

how i can do it?

Thanks a lot…