import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { AngularOnboardingModule } from 'angular-onboarding';
@NgModule({
declarations: [
AppComponent,
DashboardComponent
],
imports: [
BrowserModule,
AngularOnboardingModule.forRoot({
steps: [
{
id: 0,
text: 'This is your home!',
path: '/'
},
{
id: 1,
text: 'This is your dashboard!',
path: '/dashboard'
}
]
}),
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<button #logoutButton>Logout</button>
<ao-step id="0" [element]="logoutButton" location="above"></ao-step>
import { Component, AfterViewInit } from '@angular/core';
import { AngularOnboardingService } from 'angular-onboarding';
import { Router } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewInit {
constructor(private router: Router, private aoService: AngularOnboardingService) {
aoService.navigateSubject.subscribe(path => {
router.navigateByUrl(path);
});
}
ngAfterViewInit() {
this.aoService.start();
}
}
Essential for functionality of the library, adds the backdrop.
Element correlating to the steps passed to the library.
It should be placed in the component that has the reference element in it.