angular-intro.js
angular-intro.js copied to clipboard
Specify text in html and not in angular controller
Hi , This is more of a request rather than an issue..
Is it possible to specify the text inside the HTML. something like this:
<a href='http://google.com/' ng-intro-text='Hello step one!'></a>
This can be useful when you want to use I18n in your HTML
What would be a good way to implement this? My first thought is... create a directive, ngIntroText. It could then $emit
the text and element-ID upwards to the ngIntroOptions
which is listening in. ngIntroOptions
then loops through the options array, looking for a matching element, then sets the intro property.
However, the element itself isn't necessarily set as #step23
but can be document.querySelector("#step23")
or a function, which makes it harder to match.
This is easy to match on:
{
element: '#step2',
...
I'm not sure how to match on this:
{
element: document.querySelectorAll('#step2')[0],
...
We may implement like i said on #26
create a new directive that push a step inside the service. we'll have the current element and the text.
That should work.