ng2-semantic-ui search/select with ajax lookup
The Issue
When using ng2-semantic-ui select or search components, the lookup function cannot find the service and always returns 0 results.
When using ng2-semantic-ui select or search components, the lookup function cannot find the service and always returns 0 results.
I spent quite a bit of time trying to figure out why my angular service did not throw an http error correctly to all components watching it. Some times it would work and some times it would not. This is easier to see by looking at some code.
The Angular 2 router will only update the target component with the url and params. Each component is initialized only when it comes into view. If it already visible when the url changes, it will not be updated by the router. For google, angular 2 components not updating when url changes.
If you’re used to using Angular 1 with ui-router ($state and $stateParams services), using Angular 2 can be frustrating. Instead of using ui-router, we will try to stick with the barebones Angular 2 setup. Angular 2 has its own routing component that has been a huge improvement over the Angular 1 routing component. However, it does not follow the same design as ui-router, which was much easier in my opinion.