ng-if condition is breaking Project Actual Vs Allocated widget

Lupita
Tera Contributor

Hello community

 

I have a requirement to hide Project Actual Vs Allocated widget if a variable on the project record is true but when we added ng-if="!data.isFalse" on the body HTML, chart is not totally loaded, if we remove condition it is working fine.

 

This is what it is loading with condition 

 

Lupita_0-1710458964192.png

And this is the error I am getting on console:

js_includes_sp_libs.jsx?v=02-19-2024_0243&lp=Tue_Mar_12_11_44_47_PDT_2024&c=23_381:137 Error: Highcharts error #13: www.highcharts.com/errors/13/

 

Code is OOTB but just adding ng-if condition at the beginning

<div ng-if="!data.isFalse" class="panel panel-{{::c.options.color}} b">
  <div class="panel-heading">   
          
    <div ng-if="!data.projectCurrencySelected" class="panel-title">${Cost (Planned vs. Actual)}</div>
    <div ng-if="data.projectCurrencySelected" class="panel-title">${Cost in Project Currency (Planned vs. Actual)}</div>
  </div>
      <div class="panel-body">
          <div class="report-container">
              <div id="budget-vs-actual-report" class="report-class" >
              </div>
          </div>
      </div>
</div>

 

I logged value from data.isFalse variable and I am getting true / false depending on the PRJ selected so those are the correct values but for some reason it breaks chart load.

 

Anyone have any idea?

1 REPLY 1

Lupita
Tera Contributor

Solved by using ng-show instead of ng-if in a separate <div>