-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when routing to a component with output bindings #3099
Comments
definitely agree. Putting on the 1.0 roadmap
I'm more open to supporting |
What I initially tried was something like:
,where the home component has a binding:
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. |
Yep, the
If you just want to pass the function down, it works fine as an object http://plnkr.co/edit/xJD0qgct6u8PaIjQ1LWc?p=preview but I'm not sure you can do something useful in a "Resolve callback function". (shrug) |
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: