tables should run with their own scope#119
Conversation
without this if you put _two_ tables in the same parent controller view they collide on their data and have their own data
|
I'm really not sure about the implication of this @ahgittin. Some tables have custom templates for columns that use the current scope to get the data from. Creating a child scope for each table will break this pattern |
|
As discussed, I think you are right, it is a little more subtle (1) if attrs refer to parent scope vars, and (2) if templates refer to parent scope vars. But we do want enough separation/isolation to be able to put multiple tables in the same view without them clobbering each other. Will continue investigating. |
|
the effect of it can still see all fields from the parent that were defined when the table was created. in worst case, a caller/parent may have to initialize a field in the scope prior to creating the table (eg in the parent's controller) whereas previously they did not (since the scope was shared) and scope fields could be lazilly initialized. i've tested with complex tables and with a one line fix to initialize a scope field to be a null list, it works fine with |
|
Great, sounds good enough for now @ahgittin, but we should keep an eye on it just in case. |
without this if you put two tables in the same parent controller view they collide on their data and have their own data