ng-ghost-rider v1.0.2
Features
✅ Router support ✅ Styleable content ✅ Ships with events ✅ No dependencies ✅ 100% Angular ✅ Multiple tour support
Usage
- Install the library with
npm i ng-ghost-rider
- Add the stylesheet to your global styles file
💡 After you import the stylesheet, you can override the css / scss to fit your application's needs 😃
@import '../node_modules/ng-ghost-rider/styles/ghost-rider.scss';
or
"styles": [
"src/styles.scss",
"./node_modules/ng-ghost-rider/styles/ghost-rider.scss"
],
in your angular.json
file
- Add the module to your application
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
GhostRiderModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
- Then, set up any elements you want to be used as steps
<!-- These directives can be placed anywhere in your application -->
<h1 [ghostRiderStep]="{
name: 'tour.firstStep',
title: 'Step 1 title',
content: 'Step 1 content'
}">
Step 1
</h1>
<h1 [ghostRiderStep]="{
name: 'tour.secondStep',
title: 'Step 2 title',
content: 'Step 2 content'
}">
Step 2
</h1>
- Inject the GhostRiderService into the component that you'd like to start the tour from
import { Component } from '@angular/core';
import { GhostRiderService, GhostRiderStep } from 'ng-ghost-rider';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(
private readonly _ghostRiderService: GhostRiderService,
) {
this._ghostRiderService.start(
'tour',
[
new GhostRiderStep('firstStep'),
new GhostRiderStep('secondStep'),
new GhostRiderStep('thirdStep'),
// 💡 Optionally provide sub steps (for inner steps within the parent step... coming soon!)
/*
new GhostRiderStep(
'thirdStepWithSubSteps',
[
new GhostRiderStep('firstSubStep'),
new GhostRiderStep('secondSubStep'),
]
)
*/
]
);
}
}
- Enjoy the ride!
Contributing
Feel free to report any bugs / issues here
Local Dev
- Fork and clone this repo
- Build the package
npm run ghost-rider:build
orpnpm run ghost-rider:build
- Run
ng serve
for a dev server. Navigate tohttp://localhost:4200/
. The app will automatically reload if you change any of the source files (you'll have to build the package after changing the source code under 'projects').
🔨 Build
Run npm run ghost-rider:build
or pnpm run ghost-rider:build
to build the project. The build artifacts will be stored in the dist/
directory.
🚀 Publishing
Run npm run publish
or pnpm run publish
to build the package and publish a new version to npm.
🧪 Running unit tests
Run ng test ng-ghost-rider
to execute the unit tests via Karma.
License
MIT License
Copyright (c) 2022 Freddy Silber freddy.silber@gmail.com (https://ng-ghost-rider.github.io/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago