As with any new framework there’s that period where you keep making the same error, do some research, fix it, do the same thing again 2 hours later … rinse and repeat.
So to help you do reader (and frankly, me) I’ve been jotting down some common errors I keep seeing and document the fixes.
I’ll expand as I see more. Found some too? Add in the comments and I’ll update the post.
Can’t bind to ‘ngForIn’ since it isn’t a known native property in X
You have something like this:
You’re a C# developer aren’t you?
Simply change “in” to “of” and you’re sorted .
“No provider for ConnectionBackend”
Love this one!
When injecting Http as a dependency (or at least via TypeScript you may use something like this:
Like you would with pretty much any other dependency. As you’ve found (hey, you’re reading this article!) it doesn’t work. Try this instead:
Component doesn’t appear … but no errors
The number of times this one has hit me!
- Child component doesn’t render
- No errors in the developer console
- What gives?
Most likely you’ve neglected to add the child component references to the directives declaration.
“Component X has no route config”
This ocurred when I was traversing from one component (TodoList) to another (TodoEdit). Here’s the code from TodoList I’m travelling from.
But the error was Component ListPage has no route config - ListPage being the component I’m travelling from.
The error was indeed to do with my @RouteConfig but had nothing to do with ListPage. It was the component being travelled to which was the problem, ToDoEdit.
Instead of ToDoEdit, I had TodoEdit defined in my @RouteConfig:
Lesson here is, check the case of your route configuration
Granted there aren’t many here. I fully intend to screw up even more than usual and add further findings .