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
When routing to a component that has any output bindings ('&'- bindings), ui-router fails with this error:
TypeError: Cannot read property '2' of null at https://unpkg.com/[email protected]/release/angular-ui-router.js:7096:54 at Array.map (native) at scopeBindings (https://unpkg.com/[email protected]/release/angular-ui-router.js:7096:7) at getBindings (https://unpkg.com/[email protected]/release/angular-ui-router.js:7101:17) at Array.map (native) at getComponentInputs (https://unpkg.com/[email protected]/release/angular-ui-router.js:7109:21) at config.templateProvider (https://unpkg.com/[email protected]/release/angular-ui-router.js:7074:34) at invokeResolveFn (https://unpkg.com/[email protected]/release/angular-ui-router.js:2786:37) at processQueue (https://unpkg.com/[email protected]/angular.js:16383:28) at https://unpkg.com/[email protected]/angular.js:16399:27
I understand from this issue that these bindings are not supported, but I still think, that ui-router should be able to route to these components, ignoring the output bindings, or at least display a more descriptive error message.
Of course, supporting these bindings would be another option. Maybe I'm approaching the component based architecture wrong, but I find myself writing several "wrapper"-components that wrap around the reusable other components to make ui-router able to route to them. I feel that this wrapping could more cleanly be handled with ui-router. Any comments on support for output bindings?
Regards,
Lucas
The text was updated successfully, but these errors were encountered:
The problem with this lies in the way the template would have to be generated, being aware of the parameters that are passed to the output function from inside the component.
I don't have a good idea on how to solve this, other than supporting only selected patterns, like the one suggested by Todd Motto here. I guess this would be somehow similiar to the Angular 2 approach.
being aware of the parameters that are passed to the output function from inside the component.
Yep, the & function binding implies a lot more than "pass this function down to the binding". It has implications for the context of the function (in components, it's invoked in the context of the parent) and also the parameter name mappings.
What I initially tried was something like:
If you just want to pass the function down, it works fine as an object < binding.
See this Plunker: http://plnkr.co/edit/MppbR9UAlw7JkBW0JdD8.
When routing to a component that has any output bindings ('&'- bindings), ui-router fails with this error:
TypeError: Cannot read property '2' of null at https://unpkg.com/[email protected]/release/angular-ui-router.js:7096:54 at Array.map (native) at scopeBindings (https://unpkg.com/[email protected]/release/angular-ui-router.js:7096:7) at getBindings (https://unpkg.com/[email protected]/release/angular-ui-router.js:7101:17) at Array.map (native) at getComponentInputs (https://unpkg.com/[email protected]/release/angular-ui-router.js:7109:21) at config.templateProvider (https://unpkg.com/[email protected]/release/angular-ui-router.js:7074:34) at invokeResolveFn (https://unpkg.com/[email protected]/release/angular-ui-router.js:2786:37) at processQueue (https://unpkg.com/[email protected]/angular.js:16383:28) at https://unpkg.com/[email protected]/angular.js:16399:27
I understand from this issue that these bindings are not supported, but I still think, that ui-router should be able to route to these components, ignoring the output bindings, or at least display a more descriptive error message.
Of course, supporting these bindings would be another option. Maybe I'm approaching the component based architecture wrong, but I find myself writing several "wrapper"-components that wrap around the reusable other components to make ui-router able to route to them. I feel that this wrapping could more cleanly be handled with ui-router. Any comments on support for output bindings?
Regards,
Lucas
The text was updated successfully, but these errors were encountered: