Comments (7)
Yeah, you should totally be able to do that. Let me write up a test case as an example to demonstrate, and if it doesn't work I'll add that feature.
from ember-shepherd.
@davidpike7 so, you should already be able to do that with something like this:
triggerFlashMessage: on('init', function() {
const tour = this.get('tour');
tour.on('complete', function() {
// Tour has been cancelled
});
})
However, I really like the use of on
to clean that up a little. I'm not sure how on
works with the Evented
mixin that Ember provides, which is what the tour
service uses. I'll look into that, though.
from ember-shepherd.
So, I tried getting the syntax that you used working and found some confusing behavior. It seems like Ember.on
works with the Ember.sendEvent
method. I created an object set up like this:
var someClass = Ember.Object.extend({
tour: service,
testOnInit: on('init', function() {
var tour = this.get('tour');
tour.on('start', function() {
assert.ok(true, 'The `start` event was observed from the init hook');
});
}),
tourDidStart: on('tour.start', function() {
assert.ok(true, 'The `start` event was observed using the `on` helper');
})
}).create();
and only the hook set up in the init
method was run. I'm not sure if it's possible to get it to work with the Ember.on
method as well, but this Stack Overflow post seems to suggest that the events are not compatible with one another.
from ember-shepherd.
Nice work. Keep me posted with how you get on!
from ember-shepherd.
Sorry I just now saw this issue, GitHub doesn't notify me well about activity on this repo, for some reason.
from ember-shepherd.
So should we close this issue @alexlafroscia ?
from ember-shepherd.
Yeah, I'm pretty sure that it's not something that Ember supports right now, as the test I wrote in #20 shows
from ember-shepherd.
Related Issues (20)
- set steps error HOT 3
- Default buttons in defaultStepOptions HOT 1
- Empty Changelog HOT 1
- feature request: allow to add custom content to buttons HOT 2
- lazily load shepherd dependency HOT 6
- Move disableScroll to Shepherd HOT 7
- Remove default CSS HOT 1
- Tour does not close on Route Transitions HOT 7
- 6.0.0 npm error: node_modules/ember-shepherd: Appears to be a git repo or submodule. HOT 6
- Explore Ember generators for tour setup HOT 2
- Documentation website seems not to work for ember-shepherd@<9 HOT 1
- AttachTo doesn't find elements in ember-wormhole HOT 11
- Clicking cancelIcon doesn't trigger "cancel" event. HOT 16
- Acceptance Testing Tour causes second test to fail HOT 5
- Link broken in docs HOT 1
- Suggestion: Option to disable inline styles HOT 2
- Loading Chunk n Failed (In Prod) HOT 11
- Tours are not testable HOT 6
- Why was modalContainer attribute removed since version 4? HOT 3
- Error: Loading chunk 0 failed HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-shepherd.