Cumulocity - get access to datapoint modal

98 views Asked by At

I'm trying to get an access to datapoints in new cumulocity version. In older version such things as c8yDataPointSvc and schemaPropertiesSvc. I can't seem to find them anywhere. Basically I need components to work with datapoint as in the picture below. I would appreciate any info on how to either reuse those old components or a new way of using them as there is such. Thanks a lot!

enter image description here

1

There are 1 answers

0
Dafina Karamanoleva On

I see here three options. First what I am going to say is that we in Cumulocity use a hybrid approach for our core applications, since we have a lot of functionalities still written in AngularJS. Same as the one that you need. There is no equivalent in Angular yet. That is why you have several options to use those old services.

One is in a hybrid application to you a bridge service where you can define the upgraded c8yDataPointSvc like that -

constructor(
    private ng1Injector: any,
    ...
  ) {}

  get ng1DataPointSvc() {
    return this.ng1Injector.get('c8yDataPointSvc');
  }

This ng1Injector is a constructor input variable that we define when we provide that bridge service in the upgrade module like this:

{
  provide: BridgeService,
  useFactory: BridgeFactory,
  deps: ['$injector', ...]
}

This way you will still have an Angular application, you will still use the provided from us factory c8yDataPointSvc in your Angular application just by upgrading it using anguar hybrid app upgrade functionality.

Other option is to just keep your widget an AngularJS one and when you have a hybrid app, you can just import the AngularJS widget and the angular compiler will take care of the upgrade/downgrade. This is what we are doing with a lot of our customers, who have angulatJS widgets and are using Cumulocity versions above 10.5.0.*

And the last option will be to not use the AngularJS services you need and using our SDK just implement the functionalities used from c8yDataPointSvc. But that will be the biggest effort probably.