Skip to content

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