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

Apply current scope when initializing directive #74

Merged
merged 2 commits into from
Aug 19, 2016

Conversation

daniloisr
Copy link
Contributor

The problem happens when using interpolate/compile.
Example w/ problem: http://plnkr.co/edit/HnWlthYQ2cPT39Xn9rjF?p=preview
Example fixed: http://plnkr.co/edit/eWa4js8kaR04ROesvayp?p=preview

My hljs directives weren't updating on the first event, so I noticed that the current code checks for newVal !== oldVal and for the first event newVal is equals to oldVal, because the first render isn't applied using $digest, instead it is called directly with _elm.html(interpolateFn(_interpolateScope));.

Hope this help :)

Bonus: I also dropped unused $log dependency

Calls $apply() when using interpolate to prevent the first input being dropped
@pc035860 pc035860 merged commit 6d9b2a1 into pc035860:master Aug 19, 2016
@pc035860
Copy link
Owner

Thanks for the PR! 👍

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.

2 participants