Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import guidance required #9

Open
rajeshkumaryadavdotcom opened this issue May 26, 2020 · 4 comments
Open

Import guidance required #9

rajeshkumaryadavdotcom opened this issue May 26, 2020 · 4 comments

Comments

@rajeshkumaryadavdotcom
Copy link

I am using angular 9 and you mentioned to put -
imports: [ ... SpeechModule, ],

which is fine but it's giving error and reason I think I need to define import at top of file,
I tried
import { SpeechModule } from 'ngx-speech';
getting error

Please specify this import from where this SpeechModule needs to be imported in app.module.ts after installing ngx-speech

I wanna use this to https://www.rajeshkumaryadav.com/#/auth when user will authenticated, it will say you can choose any of pages just say the name, for example you can say 'About' once user will listen this from my existing code, role of your ngx-speech will start, your ngx-speech will take input as 'About' and then I will code for it to set the route for about.

Please answer about import on priority basis.

@ebrehault
Copy link
Collaborator

ebrehault commented May 27, 2020

Hi!

Maybe it is not clear, but you should not write the 3 dots in the imports, the 3 dots represents the other modules you might already have, like:

imports: [
    BrowserModule,
    FormsModule,
    SpeechModule,
]

And yes, you have to import the module in order to have it working.

@rajeshkumaryadavdotcom
Copy link
Author

Hi,

I understand ... means exising code, I think you understood my question wrong way, my mistake.

I am not asking about imports, I a asking about import

import ABC from 'abc'

I am asking about this import

You are telling me
imports: [ABC]

if we import anything at top level of app.module.ts then we import it in ngmodule's import, you are missing top level import and visual studio code and angular cli is giving error.

@rajeshkumaryadavdotcom
Copy link
Author

rajeshkumaryadavdotcom commented May 28, 2020

image
I am asking about import which you can see on line number 58 but you are telling me about imports as line number 86

When we do import then we add then name of import to imports, you have done imports correctly but you have not mentioned import, thus i tried like

import { SpeechModule } from 'ngx-speech';

But this is not working,

Can you please guide me how to import SpeechModule as line 58 ?

@ebrehault
Copy link
Collaborator

I have just tried the following:

ng new testproject
npm install ngx-speech

Then go to app.module.ts and add at the top:

import { SpeechModule } from 'ngx-speech';

then add SpeechModule in imports:

imports: [
        BrowserModule,
        SpeechModule,
]```

It worked well, I could launch `npm start` with no error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants