Skip to content

Fix dynamic templating for Angular 1.2 #31

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

Merged
merged 1 commit into from
Nov 27, 2013

Conversation

tdumitrescu
Copy link
Contributor

Small fix which should take care of #29

If the timer tag has dynamic content (e.g., <timer>my content with {{seconds}} etc</timer>), the controller now treats it the same way as it does in the default case (<timer/>, which inserts <span>{{millis}}</span>): it grabs the desired markup from the element and $compiles it with the timer's isolated scope; otherwise in Angular 1.2 it would get rendered with the parent scope and have no access to the timer's scope vars.

This does wrap the dynamic content in span tags so that Angular can compile it properly. Maybe it would make more sense for them to be divs so that you could use almost any arbitrary markup within the timer tag.

…c template content</timer>), so that it can reference scope vars as within the timer's isolated scope.
@siddii
Copy link
Owner

siddii commented Nov 27, 2013

Awesome... It works like a dream! I am merging it to the master.

siddii added a commit that referenced this pull request Nov 27, 2013
Fix dynamic templating for Angular 1.2
@siddii siddii merged commit e36e6a6 into siddii:master Nov 27, 2013
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