-
Notifications
You must be signed in to change notification settings - Fork 397
Make the timeago directive expand into a standard HTML5 time element #41
Conversation
…hange the contents of the element until a date is given
Addressed a few broken tests but couldn't figure out the remaining two |
@gsklee Nice to meet you and thank you for your contribution. I will review the changes shortly. Meanwhile, can you please share the motivation behind using the HTML5 time element? |
@urish because it's the standard way to wrap any time-related value in HTML5 rather than |
Well, yea, this makes a lot of sense. So yeah, we will start using the |
Cool, would be great if you have any ideas on the |
Jasmine 2.0 provides a new syntax for specs, as you can read here. |
@gsklee I have reviewed your implementation, what is the motivation behind using |
@urish As mentioned in 0dba36b, it's added to fulfill an existing test: https://github.com/urish/angular-moment/blob/master/tests.js#L149 |
Without the transclusion the initial text will be replaced by the template completely. |
Thanks @gsklee, this makes sense. I'm considering a more light-weight implementation, where no additional scope is created and no transclusion is needed:
Thoughts? p.s. I really appreciate all the time you put into making |
@urish So to summarize, you'd like to see the transclusion and the isolated scope both being removed, and just wrapping the directive with |
@gsklee Exactly, you got it short and to the point! |
@urish I've implemented condition 1; actually this is the only use case I care about. Let me know if you like it and, if it gets merged in, we'll see if it's desirable to implement condition 2 as well =) |
This PR makes the
amTimeAgo
directive to always expand into a<time>
element per HTML5 standards:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
http://html5doctor.com/the-time-element/
While there are 6 commits, the one that matters is 1c24b26.