$Model global syntax performing like local

  • 1
  • Problem
  • Updated 3 years ago
  • Not a Problem
I have a template using 

{{$Model.MYModel.data.length}} 

on 2 pages.

This only works on page1 if the component's model is set to MYModel. If It is set to any other model it displays 0.

On page2 it works exactly as expected.

What are the factors that could cause this problem (and yes, the model does have rows)?
Photo of Matt Hoffman

Matt Hoffman

  • 172 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Matt, check the templates' settings... does one have "Do not run template on each row" checked?
Photo of Matt Hoffman

Matt Hoffman

  • 172 Points 100 badge 2x thumb
I figured it out.  I had to change it to a component and subscribe to the model and wait for it to load.  Thanks.