Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Moving logic from LinkingFunction to controller. #657

Closed
wants to merge 1 commit into from
Closed

Moving logic from LinkingFunction to controller. #657

wants to merge 1 commit into from

Conversation

AdrienGiboire
Copy link

Everybody, I'm quite new to AngularJS so I think there is a lot to tell about my work… At least, I ensure tests stay green :)

My original need is to use the Datepicker component but make it able to render days where there is planned day. I started to extend it by creating a new directive with the same name. But I needed to access to some function, as refill to call a function of mine which bind days to their respective events and set a class to the related days.

As refill was is in the LinkingFunction, I could not access it through my own LinkingFunction.

Here is my PR to allow people to extend the component default behavior.

Please criticize, please be gentlemen!

Move logic from datepicker LinkingFunction to controller so the behavior of the component can be easier to extend.
@pkozlowski-opensource
Copy link
Member

@AdrienGiboire I think this is a good move in general, we just need to be careful about the public API exposed by a controller. Having said this @bekos is already working on a very similar refactoring, WIP here:
#652

@AdrienGiboire
Copy link
Author

Arf… Thanks @pkozlowski-opensource. I didn't notice the WIP by @bekos.

For what you said about the public API, do you have general advices?

@pkozlowski-opensource
Copy link
Member

@AdrienGiboire There seems to be ongoing refactoring-related discussion in #652 so I would suggest concentrating efforts in that PR.

As for the "public API advice": expose as little as possible is always my best call. Start small, with an absolute minimum and only add more things when people got valid use-case. Basically as soon as something is part of the public API we are commitng ourselfs to maintaining a contract. And pain of maintaining gets bigger as an API gets bigger.

Going to close this one, let's focus on #652

@AdrienGiboire
Copy link
Author

👍

codedogfish pushed a commit to codedogfish/angular-ui-bootstrap that referenced this pull request Sep 15, 2015
Enable tagging without multi selection (see angular-ui#597)
codedogfish pushed a commit to codedogfish/angular-ui-bootstrap that referenced this pull request Sep 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants