Giter Club home page Giter Club logo

Comments (18)

isaacplmann avatar isaacplmann commented on August 16, 2024 8

Change

import { TourService } from "ngx-tour-core";

to

import { TourService } from "ngx-tour-md-menu";

You also won't need to include ngx-tour-core in your package.json. ngx-tour-md-menu includes it automatically as a dependency.

from ngx-tour.

Shane-E avatar Shane-E commented on August 16, 2024 1

Change

import { TourService } from "ngx-tour-core";

to

import { TourService } from "ngx-tour-md-menu";

You also won't need to include ngx-tour-core in your package.json. ngx-tour-md-menu includes it automatically as a dependency.

I'm not sure if it's ever desired to import TourService from ngx-tour-core so if that's the case maybe it would make more sense to update the public_api to reflect that so people don't have the option to import it from there in the first place

from ngx-tour.

pyarun avatar pyarun commented on August 16, 2024

Created new angular cli project.

  1. ConsoleModule Works. BootstrapModule does not work.

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

I tried using TourNgBootstrapModule in a fresh project and ran into a few issues. Released 1.0.4 and updated the docs. Let me know if you're still having problems.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

I also didn't succeed to run.

  • Firstly, the console demo on your page, does not work for me. "Start Demo Tour" does nothing. Clicking on Prev / Next buttons, logs "Can't get next step. No currentStep" kind of messages in the console. I use Chrome.

Below is what I tried and how I failed to run:
App Module:

import { TourMdMenuModule, TourService } from 'ngx-tour-md-menu';
@NgModule({
  imports: [
	TourMdMenuModule
  ],
  declarations: [
  ],
  bootstrap: [MasterComponent],
  providers: [
    TourService
  ]
})

master.component.html:

<tour-step-template></tour-step-template>
<div tourAnchor="panel.home.linkbox.company">aa</div>
<div tourAnchor="panel.home.linkbox.organizations">bb</div>

master.component.ts

export class MasterComponent {

    constructor(private tourService: TourService) {
        this.setupTour();
    }   

    public setupTour(): void {
        this.tourService.initialize(this.buildTourSteps());
        this.tourService.start()
    }
    private buildTourSteps(): any[] {
        let steps: any[] = [];

		steps.push({
			anchorId: 'panel.home.linkbox.company',
			content: 'This is the main page for your Company’s profile and billing settings. ',
			title: 'Company Settings',
		});
       

        steps.push({
            anchorId: 'panel.home.linkbox.organizations',
            content: 'Here you can manage the organizations of your company.',
            title: 'Organization Management',
        });

        return steps;
    }

}

When I try to run, I am getting the error below:

No provider for TourStepTemplateService!

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

@mustafaekim

  1. The Console demo has the tour started initially. Clicking the "Start Tour" button will toggle it off and then the "next" and "prev" buttons will display the warnings you mentioned. Click "Start Tour" again and they should work.

  2. In your app, you need to import TourMdMenuModule.forRoot() so that it will register the providers it needs. You need to use forRoot() because you don't want multiple copies of that provider.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

I've put TourMdMenuModule.forRoot() into imports, still having error. I think there is a lack of real documentation. I dont see the big picture.

Error:
ERROR Error: Uncaught (in promise): Error: No provider for TourService!
Error: No provider for TourService!

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Where are you getting TourService from in master.component.ts? What is your import line?

Yep, documentation always needs work. I'd love help with that.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

(I clear others and keep only what interest us for simplifying)

app.module

@NgModule({
  imports: [
    TourMdMenuModule.forRoot()
  ],
  declarations: [
  ],
  bootstrap: [MasterComponent],
  providers: [TourService]
})

master.component.ts

import { TourService } from "ngx-tour-core";

@Component({
    selector: 'my-app',
    templateUrl: './master.component.html',
    styleUrls: ['./master.component.css']
})
export class MasterComponent implements OnInit {
    constructor(
        , tourService: TourService
    ) {
...

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

I see in my docs that I don't say you need to import TourMdMenuModule.forRoot(). I'm updating that now.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

Voila! It now worked. Thanks for support. Otherwise, from my point of view, it is not easy to figure out those mistakes.

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Yeah, those are difficult bugs to track down if you're not the library maintainer. Let me know if you have ideas for how the docs could be improved.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

Best is to have the online repository of the demo so that people can look.

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Here it is.

from ngx-tour.

mustafaekim avatar mustafaekim commented on August 16, 2024

I wish I did see this link before. Is it on the demo page? If not, you may consider giving a link.

Besides, lazy loading makes it hard for beginners to understand. You should keep the demo simple.

Lastly, when naming components/libraries in a demo, I would recommend to make it clear that those file are example file. However a file with a name md-menu.component.ts makes me think, is this a demo, or somrthing I need? So I feel required to check inside. Naming can state that this is a demo component: like. demo-md-menu.component.ts

Thanks for your support

from ngx-tour.

deepaksinghrv avatar deepaksinghrv commented on August 16, 2024

Error - Cannot find name 'TourNgxBootstrapModule'.
when i import TourNgxBootstrapModule.forRoot() in app.module

from ngx-tour.

shaggyyy avatar shaggyyy commented on August 16, 2024

I am facing similar kind of issue
NullInjectorError: R3InjectorError(DynamicTestModule)[TourStepTemplateService -> TourStepTemplateService]:
NullInjectorError: No provider for TourStepTemplateService!

and this is happening only in one module rest are working fine. Already imported the TourService in providers and checked the import source.

from ngx-tour.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.