3 ms·
> Could you explain a bit more about the tooltip issue you've mentioned? Say that you have a dynamically generated form where an input should display a tooltip
by mackwic 13y ago
> Could you explain a bit more about the tooltip issue you've mentioned?
Say that you have a dynamically generated form where an input should display a tooltip only in specific cases.
Using tooltip="" will not do the trick, you have to do some sorcery to attach dynamically your tooltip, aKa: using compiler in your controller to replace dynamically the DOM region with the DOM elements returned by $compile and jQuery.
> I find that services are relatively essential building blocks for my applications.
But they doesn't help much against the issue of feature scaling.
Some UI logic just can't be factorized. Some other data handling is to specific to be re-used elsewhere. In a large business application, logic is poor but corner cases are legion. We made the choice to keep our specific logic near the place they are used against using services because that doesn't add any value.
> Providers are there so that you can preconfigure your modules
Again, thats what the rest of the world call 'a factory'. You can perfectly imagine a Factory that register in $injector it's instances. IY think Provider should stay something internal and not be documented as a feature everyone can use. It's not.
> I can see how $rootScope could be perceived as code smell but after examining how angular uses it internally I'm ok with the way I use it.
I am too. But I don't want anyone else than hackers to use it.
> Directives are confusing the first time you see them.
They are confusing because everything is blend together. Separate the different use cases and everything will be simpler. Even if it's the same internal thing (that you can use directly if you need).
My point is that if you provide different handlers, noone will ever fear the directives.
> You can create really amazing components that are totally reusable on your other projects.
If only...
In the real world, there is no way my current employer will accept I'll reuse his code for my next project. Only FLOSS libraries can do that.