$tm1Ui.cellGet use ng-model


Hi all

I have a $tm1Ui.cellGet to get certain cell value in TM1.
When i replaced an element name with an ng-model name, the code stops working.
Does it mean $tm1Ui.cellGet doesn’t support variable?

This is how i used it:

in html: ng-model="example";
in js: $tm1Ui.cellGet('instanceName', 'cubeName', 'Ele1', 'Ele2', $scope.example);



Hi Tina,

the cellGet function certainly accepts variables.

My assumption would be that the initialization of $scope.example in the HTML doesn’t work as expected.
Did you check if $scope.example actually has a value through {{example}} in the HTML ?




Hi @twu,

Note that the controller (js) loads first before the html.

So the case above, if you are trying to execute the cellget without any interaction or button from the HTML page, then the above will not work.

Otherwise, as @mwirtz has mentioned, check if your example variable has a value.



Hi @plim

Is there any way to tell the cellGet to wait till this variable has value?


Hi @twu,

There are ways, but how you initialize that variable may already give you that. Where are are you using this? In a directive? Can you post the HTML code on how you initialize this on your HTML page?



Hi @plim

I am using it in a SUBNM:

    tm1-dimension="Sys Upload Specification"


Hi @twu,

One way is to just update the setModule(data) function, and add a call to your cellGet. That way, you will be assured that it gets called when the value is available.

If you want it to be called once time only, you can create a flag, or a counter so that it only gets once.



Thanks! adding to setModule(data) works.