You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by nooelan May 10, 2021
My model contains data that are multi-dimensional, and my first attempt was to implement this as a regular C# multidimensional array similar to this:
object[,] matrix3x3 = new object[3,3];
When trying to access this type of object from a template, Handlebars.Net threw an exception complaining it could not convert from object[ , ] to object[].
Then I changed my model implementation to jagged arrays (similar to this):
object[][] matrix3x3 = new object[3];
for (row = 0; row < 3; ++row)
matrix3x3[row] = new object[3];
This works just fine with Handlebars.Net.
Question: Is the lack of support for regular multidimensional arrays intentional, or is it a missing feature or bug?
As regular, multidimensional arrays are more efficient, at least for 2D arrays according to C# guidelines, I think it is a good idea to add support for it. It will also help avoid having to change the implementation of an already existing model.
Activity
mike-warren-dev commentedon Feb 10, 2023
I'll work on this if you still want it, @zjklee
oformaniuk commentedon Feb 15, 2023
Thanks @mike-warren-dev, I'd appreciate a PR ;)
feat: support multi-dimensional array indexing and iteration (issue #483
feat: support multi-dimensional array indexing and iteration (issue #483