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

Use with Ionic (3) - 'word-cloud' is not a known element #16

Open
WieFel opened this issue Nov 5, 2018 · 0 comments
Open

Use with Ionic (3) - 'word-cloud' is not a known element #16

WieFel opened this issue Nov 5, 2018 · 0 comments

Comments

@WieFel
Copy link

WieFel commented Nov 5, 2018

Hello,
I want to use angular-d3-word-cloud in my Ionic3 app project but I have difficulties importing the required dependencies.
I want to use the <word-cloud> element simply in my HTML, as described in https://github.com/weihanchen/angular-d3-word-cloud#directive-usage.

  1. I started by installing the module with npm install angular-d3-word-cloud.
  2. Then I created a custom copy config in order to include the required .js files into the build folder. I did this as described here: https://zerone-consulting.blog/2017/10/10/steps-to-include-custom-cssjs-files-in-ionic-3/
  3. Then, I included the js-files in the <head> of my index.html as follows:
<script src="build/angular.js"></script>
<script src="build/d3.js"></script>
<script src="build/d3.layout.cloud.js"></script>
<script src="build/angular-word-cloud.js"></script>

Note: I used angular.js, d3.js and angular-word-cloud.js instead of angular.min.js, d3.min.js, angular-word-cloud.min.js because i could not find the respective *.min.js-versions within my node_modules-folder.

However, when launching my app I get the following error:

Error: Template parse errors:
'word-cloud' is not a known element:
1. If 'word-cloud' is an Angular component, then verify that it is part of this module.
2. If 'word-cloud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
        <ion-card-content>
            <div id="wordsCloud">
                [ERROR ->]<word-cloud words="allMealNames" width="300px" height="200px" padding="5"
                           "): ng:///AppModule/HistoryPage.html@37:16

The HTML page where I'm using the <word-cloud> element looks like this:

<div id="wordsCloud">
    <word-cloud words="allMealNames" width="300px" height="200px" padding="5"
                         use-tooltip="true" transition="true" on-click="wordClicked()">
    </word-cloud>
</div>

Has anyone got a suggestion for solving this problem?
Thanks

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

1 participant