Skip to content
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

Ditching replace and using transclude #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HichemBenChaaben
Copy link

Hi Sebastian, I have a similar project and i stopped using replace for my directives.
Replace is a great feature but it was created in the early versions of angular js, now the angular team is advising people to not use it anymore for best practices.

You can use transclude and there is few advantages in here the linking function receives a transclusion function which is pre-bound to the correct scope. In a typical setup the widget creates an isolate scope, but the transclusion is not a child, but a sibling of the isolate scope. This makes it possible for the widget to have private state, and the transclusion to be bound to the parent (pre-isolate) scope.

ohh and yeah i added a line at the end cause git always complains about it :)

@HichemBenChaaben HichemBenChaaben changed the title Ditching replace and using trasclude Ditching replace and using transclude Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant