angular-intro.js icon indicating copy to clipboard operation
angular-intro.js copied to clipboard

Specify text in html and not in angular controller

Open stonehz opened this issue 11 years ago • 2 comments

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

stonehz avatar Feb 06 '14 10:02 stonehz

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],
            ...

mendhak avatar Feb 16 '14 19:02 mendhak

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.

millerscout avatar Mar 04 '17 04:03 millerscout